datestr not working properly

1 Ansicht (letzte 30 Tage)
Aadil
Aadil am 1 Aug. 2012
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 Kommentar
Aadil
Aadil am 1 Aug. 2012
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

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Andrei Bobrov
Andrei Bobrov am 1 Aug. 2012
datestr(datenum(raw,'dd/mm/yyyy HH:MM:SS'), 'yyyy-mm-dd HH:MM:SS')
  1 Kommentar
Aadil
Aadil am 1 Aug. 2012
Worked like a charm, thanks

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Dates and Time finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by