Julian day to date

4 visualizaciones (últimos 30 días)
Daphne PARLIARI el 29 de Ag. de 2020
Comentada: Med Aymane Ahajjam el 31 de En. de 2023
Hello everyone.
I have a simple (hopefuly) question. In the attached excel file, column C contains year and column D the day of year (e.g. 01/01/2007 is day 1 and 31/12/2007 is day 365).
Is there a way to convert this date type into the format dd-mm-year, with each of the three numbers in separate columns (one for the day, one for the month and one for the year)?
0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

Respuestas (1)

the cyclist el 29 de Ag. de 2020
Editada: the cyclist el 29 de Ag. de 2020
Here is one way:
julianDate = datetime(dateTable.YEAR,1,dateTable.JULIANDAY);
julianY = year(julianDate);
julianM = month(julianDate);
julianD = day(julianDate);
Of course, you don't really need to calculate the Julian year again, since it is already available as an input, but I made it for consistency.
1 comentarioMostrar -1 comentarios más antiguosOcultar -1 comentarios más antiguos
Med Aymane Ahajjam el 31 de En. de 2023
THANK YOU!

Iniciar sesión para comentar.

Categorías

Más información sobre Dates and Time en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by