Please can anyone tell me what date and time this timestamp reads

2 views (last 30 days)
{"timestamp_usec":"1410476025352017"}],"query_text":"(Current Location) -> Harper Hill Port Orchard"}

Answers (1)

Walter Roberson
Walter Roberson on 30 May 2015
It might be 11-Sep-2014 22:53:45 . Or it might be something else, depending on its source.
Timestamps in usec are sometimes given relative to Jan 1'st 1970 00:00 UTC. So take the figure, 1410476025352017, divide by 10^6 to get seconds, divide by 60 to get minutes, divide by 60 to get hours, divide by 24 to get number of days. Add that to the MATLAB time base for Jan 1st 1970 of 719529 via datenum('1-Jan-1970') to get 735853.953993056 . Then datestr() that to get the printable time, 11-Sep-2014 22:53:45.
Caution: the result should be interpreted as UTC, not your local timezone!
If you have R2014b or later, you can use the new datetime facilities to deal with timezones more properly.

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!