Convert Julian Date to Calendar Days.
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Edgar
am 2 Mai 2023
Beantwortet: Cris LaPierre
am 2 Mai 2023
I'm trying to Convert the Julian-Time header to include the Year header and output the format mm/dd/yyyy. i.e. 12/31/2022 & 01/01/2023.
The complete data for Book1.xlsx contains multiple years.
Thank you!
0 Kommentare
Akzeptierte Antwort
Cris LaPierre
am 2 Mai 2023
Perhaps a bit convoluted, but this appears to work. I haven't compared it extensively to the orginal data. Note that the display format only modifies how the data appears. The time is still there.
data = readtable('Book1.xlsx',"TextType","string");
% your Julian_dates are surrounded by quotes. Remove them
data.Julian_Time = erase(data.Julian_Time,"'");
% use datetime to convert the combined date string to a datetime.
% DDD indicates day-of-year
data.Julian_Time = datetime(data.Year+"-"+data.Julian_Time,'InputFormat','uuuu-DDD-HH:mm:ss.SSS');
data.Julian_Time.Format = 'MM/dd/yyyy'
0 Kommentare
Weitere Antworten (0)
Siehe auch
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!