I got wrong data when i use datetime convertfrom
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
주희 박
el 15 de Sept. de 2022
Hi I attached time(year:1999) data. It was nc data so when I use ncdisp, its units = 'hours since 1800-01-01 00:00:0.0'
I tried to convert it by
t=datetime(time,'Convertfrom',datenum);
And I got the answer like
'4780-11-26'
'4780-12-20'
.
.
.
Yeah it is wrong.
How can I get proper 1999 date?
0 comentarios
Respuesta aceptada
Stephen23
el 15 de Sept. de 2022
S = load('time.mat');
D = S.time
T = datetime(1800,1,1) + hours(D)
1 comentario
Más respuestas (1)
Walter Roberson
el 15 de Sept. de 2022
dt = hours(t) + datetime('1800-01-01 00:00:0.0')
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!