How to convert a number into a date
38 views (last 30 days)
Show older comments
I have two sets of numbers (Representing same day of a GPS position time series),and I do not know the their types.I want to convert either of them and obtain the day/month/year. Type 1 ( 2017.23972602740 ) and Type 2 (52634).I tried datetime(x,'ConvertFrom','datenum') and datetime(x,'ConvertFrom','juliandate') but cannot obtain correct date. Please help.
2 Comments
dpb
on 24 Mar 2020
AFAIK, TMW hasn't yet supplied a builtin conversion in datetime...
I don't recognize the second...
Answers (1)
Cris LaPierre
on 24 Mar 2020
Haven't figured out Type 1 yet, but based on this website, I think I've got a way to convert Type 2.
% GPS time
t = 52634;
tUnix = t+315964800;
dt = datetime(tUnix,"ConvertFrom","posixtime")
dt =
06-Jan-1980 14:37:14
2 Comments
dpb
on 24 Mar 2020
I figured it had something like that, but haven't ever messed w/ any GPS stuff to have actual experience...
See Also
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!