calculating the difference between 2 dates
Mostra commenti meno recenti
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
Risposta accettata
Più risposte (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 Commenti
Peter Perkins
il 15 Mar 2018
Indeed:
>> between(datetime('20-Nov-2008'),datetime('12-Oct-2011'),{'weeks' 'months'})
ans =
calendarDuration
34mo 3w
Rosanna
il 11 Ott 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
Categorie
Scopri di più su Time Series Objects in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!