This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Convert CDF epoch object to MATLAB serial date number


n = todatenum(obj)


n = todatenum(obj) converts the CDF epoch object ep_obj into a MATLAB® serial date number. Note that a CDF epoch is the number of milliseconds since 01-Jan-0000 whereas a MATLAB datenum is the number of days since 00-Jan-0000.


Construct a CDF epoch object from text that represents a date. Then, convert the object back into its original form.

dstr = datestr(today)
dstr =

obj = cdfepoch(dstr)
obj =
     cdfepoch object:
     08-Oct-2003 00:00:00

dstr2 = datestr(todatenum(obj))
dstr2 =

Introduced before R2006a