Deprecated (and not recommended) would be
which, of course, returns the datenum associated with the date; to get the representation use datestr. But, dn is a double.
The present (and recommended) way to handle dates is to use datetime instead --
NB: the input format string representations are NOT the same between the two.
dt is its own class of datetime array, not a double. But, one can do comparisons of equality, greater/less than, etc., as well as plot and such have been extended to recognize the class as inputs.