x2mdate
(Not recommended; use datetime
) Excel serial date number to MATLAB serial date number or datetime
value
x2mdate
is not recommended. Use the
datetime
function instead, with the
"excel"
input argument, because it returns
datetime
values. For more information on updating your code,
see Version History or Replace Discouraged Instances of Serial Date Numbers and Date Strings.
Description
converts an array of Excel® serial date numbers to an array of MATLAB® serial date numbers. It converts date numbers using either the
1900 date system or the 1904 date system, as specified by
MATLABDate
= x2mdate(ExcelDateNumber
,Convention
)Convention
.
MATLAB date numbers start with 1
= January 1, 0000 CE,
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
Spreadsheet Link™ software.
converts Excel serial date numbers to an array of MATLAB serial date numbers or a MATLABDate
= x2mdate(___,outputType
)datetime
array using
an optional input argument for outputType
.
The type of output is determined by an optional outputType
input. If outputType
is "datenum"
, then
MATLABDate
is an array of serial date numbers. If
outputType
is "datetime"
, then
MATLABDate
is a datetime
array. By
default, outputType
is "datenum"
.