| Financial Toolbox | Search  Help Desk |
| x2mdate | Examples See Also |
Excel serial date number to MATLAB serial date number.
Syntax
d = x2mdate(xd, dsys) d = x2mdate(xd)
Arguments
xddsys0 = 1900 date system (default), in which 1 = January 1, 1900 A.D.1 = 1904 date system, in which 0 = January 1, 1904 A.D.Description
d = x2mdate(xd, dsys)
converts Excel serial date numbers xd to MATLAB serial date numbers d. MATLAB date numbers start with 1 = January 1, 0000 A.D., hence there is a difference of 693960 relative to the 1900 date system, or 695422 relative to the 1904 date system. This function is useful with MATLAB Excel Link.
Example
Given Excel date numbers in the 1904 systemxd = [34327 34692 35057 35423];convert them to MATLAB date numbers
d = x2mdate(xd, 1)
d =
729749 730114 730479 730845
and then to date strings:
datestr(d) ans = 25-Dec-1997 25-Dec-1998 25-Dec-1999 25-Dec-2000
See Also
datenum, datestr, m2xdate