calculating the difference between 2 dates
Mostrar comentarios más antiguos
Dear all,
I would like to calculate the difference between the dates say,
20/11/08 and 12/10/2011 in weeks and in months
cheers
Respuesta aceptada
Más respuestas (1)
there's something better now since 2014 release I believe:
w = between(startRange,endRange,'weeks')
y = between(startRange,endRange,'years')
m = between(startRange,endRange,'months')
2 comentarios
Peter Perkins
el 15 de Mzo. de 2018
Indeed:
>> between(datetime('20-Nov-2008'),datetime('12-Oct-2011'),{'weeks' 'months'})
ans =
calendarDuration
34mo 3w
Rosanna
el 11 de Oct. de 2018
Hi all I have to compute the occurrence time (days from the starting date) of a large number (eg N=1000) of events, for which I have the Year, Month, Day, Hour, Minute in numerical format (eg 2008, 05, 23, 08, 34). How can I proceed? Thanks Rosanna
Categorías
Más información sobre Time Series Objects en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!