datestr not working properly

3 ビュー (過去 30 日間)
Aadil
Aadil 2012 年 8 月 1 日
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')
  1 件のコメント
Aadil
Aadil 2012 年 8 月 1 日
Worked like a charm, thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by