Financial Toolbox    
m2xdate

MATLAB serial date number to Excel serial date number

Syntax

Arguments

MATLABDateNumber
A vector or scalar of MATLAB serial date numbers.
Convention
(Optional) Excel date system. A vector or scalar. When Convention = 0 (default), the Excel 1900 date system is in effect. When Convention = 1, the Excel 1904 date system in used.
In the Excel 1900 date system, the Excel serial date number 1 corresponds to January 1, 1900 A.D. In the Excel 1904 date system, date number 0 is January 1, 1904 A.D.

Vector arguments must have consistent dimensions.

Description

DateNum = m2xdate(MATLABDateNumber, Convention) converts MATLAB serial date numbers to Excel serial date numbers. MATLAB date numbers start with 1 = January 1, 0000 A.D., hence there is a difference of 693961 relative to the 1900 date system, or 695422 relative to the 1904 date system. This function is useful with MATLAB Excel Link.

Examples

Given MATLAB date numbers for Christmas 2001 through 2004

convert them to Excel date numbers in the 1904 system

or the 1900 system

See Also

datenum, datestr, x2mdate


  lweekdate minute