datestring shows incorrect answers
2 views (last 30 days)
Show older comments
I have taken a specific date from Igor pro and import it into matlab. the corresponding integer value of the time '1/1/2016 00:00:00.058 'when i upload the file from igor pro into matlab was '3534468465.15625'. When i try to use the date string function
t=3534468465.15625;
string=datestr(t);
the output is coming as '22-Dec-7045 03:45:00'. But the required answer was '1/1/2016 00:00:00.058'. Can some one please help why this error is happening ?
0 Comments
Accepted Answer
Thorsten
on 2 Jun 2016
Edited: Thorsten
on 2 Jun 2016
Igor Pro uses the seconds since 1904-01-01. So you can convert it using
dv = datevec(3534468465.15625/(3600*24) + datenum(1904, 1, 1, 0, 0, 0))
Which gives ans =
2016.00 1.00 1.00 4.00 47.00 45.16
This gives the correct year, month and day, but the time is still wrong.
Are you 100% sure that the correct time is '1/1/2016 00:00:00.058 ' and not '1/1/2016 04:47:45.16'?
More Answers (0)
See Also
Categories
Find more on Time Series Objects 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!