Programming |
Conversions Between Date Formats
Functions that convert between date formats are shown below.
Function |
Description |
datenum |
Convert a date string to a serial date number. |
datestr |
Convert a serial date number to a date string. |
datevec |
Split a date number or date string into individual date elements. |
Here are some examples of conversions from one date format to another:
d1 = datenum('02-Oct-1996') d1 = 729300 d2 = datestr(d1 + 10) d2 = 12-Oct-1996 dv1 = datevec(d1) dv1 = 1996 10 2 0 0 0 dv2 = datevec(d2) dv2 = 1996 10 12 0 0 0
Dates and Times | Date String Formats |
© 1994-2005 The MathWorks, Inc.