datestr not working properly

1 次查看(过去 30 天)
Can someone explain this?
>> raw(3)
ans =
'22/07/2012 18:26:17'
>> datestr(raw(3), 'yyyy-mm-dd HH:MM:SS')
ans =
0028-01-02 18:26:17
It was working before, not sure why its messing up the date but not the time
Thanks,
  1 个评论
Aadil
Aadil 2012-8-1
I tried this as well same problem:
>> datestr('22/07/2012 18:26:17', 'yyyy-mm-dd HH:MM:SS')
ans =
0028-01-02 18:26:17

请先登录,再进行评论。

采纳的回答

Andrei Bobrov
Andrei Bobrov 2012-8-1
datestr(datenum(raw,'dd/mm/yyyy HH:MM:SS'), 'yyyy-mm-dd HH:MM:SS')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Dates and Time 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by