1-hour offset in time string conversion
Show older comments
Hi there, I'm having trouble in converting string to datenum values. Somehow, there will be an offset of one hour when converting back to datestr. So, here is my example:
>> timestr = '1986-03-13T11:59:58.000Z';
>> test = datenum(timestr,'yyyy-mm-ddTHH:MM:SS.000Z')
test =
7.2544e+05
>> datestr(test,'yyyy-mm-ddTHH:MM:SS')
ans =
1986-03-13T12:59:58
To me, this seems pretty weird. I might be missing something very simple, though. I'd be glad if any of you could help me! Thanks
Dennis
1 Comment
Star Strider
on 24 Oct 2014
I suggest you report this as a bug, specifically because in R2014b I get an even weirder result from running your code:
1986-03-13T04:59:58
a -19 hour error!
Accepted Answer
More Answers (1)
Dennis
on 3 Nov 2014
0 votes
Categories
Find more on Dates and Time in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!