Matlab imported excel time format change
2 次查看(过去 30 天)
显示 更早的评论
Hi
Does anyone knows how to change change matlab time format. I have time in 2 colomns, first dd/mm/yyyy and second colomn hh:mm:ss.FFF. I need to make this time in one colomn in format yyyy-mm-dd hh:mm:ss.FFF.
Thanks in advance!
0 个评论
采纳的回答
Guillaume
2017-2-8
Assuming the date and time is stored as char arrays in both columns:
dt = datetime(strcat(column1, ' ', column2), ...
'InputFormat', 'dd/MM/yyyy hh:mm:ss.SSS', ...
'Format', 'yyyy-MM-dd hh:mm:ss.SSS')
If you want it back as char arrays:
char(dt)
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!