Skip to content

datenum

time · scripts/time/datenum.m

: n = datenum (y, m, d)
: n = datenum (y, m, d, h, mi, s)
: n = datenum (dv)
: n = datenum (str)
: n = datenum (str, fmt)
: n = datenum (str, fmt, pivot)
: [n, secs] = datenum (…)

Serial date number: days elapsed since the calendar origin, with datenum (0, 1, 1) == 1. Time of day is a fraction of a day.

Months, days, hours, minutes and seconds outside their usual range roll over into the next larger unit. Strings are converted with datevec. The optional second output is the date number expressed in seconds.