Conversion of Gregorian date to decimal years
17 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Ahmet Hakan UYANIK
il 9 Mag 2021
Commentato: Walter Roberson
il 10 Mag 2021
Hi,
I have time series given in gregorian time in seconds since 1992-01-01 00:00:00'. For example; 23853938,23853939...
How can i convert this gregorian time seconds to decimal years like 2010.544, 2010.545...
0 Commenti
Risposta accettata
Walter Roberson
il 10 Mag 2021
basetime = datetime('1992-01-01 00:00');
gtime = 23853938
t1 = basetime + seconds(gtime)
t2 = dateshift(t1, 'start', 'year')
t3 = dateshift(t1, 'end', 'year')
fy = year(t1) + (t1-t2)./(t3-t2)
3 Commenti
Walter Roberson
il 10 Mag 2021
decyear() appears to require the Areospace Toolbox.
Also, setting the Format is not required for decyear()
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Time Series Objects in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!