| MATLAB Function Reference | Search  Help Desk |
| datestr | See Also |
str = datestr(D,dateform)
str = datestr(D,dateform)
converts each element of the array of serial date numbers (D) to a string. Optional argument dateform specifies the date format of the result, where dateform can be either a number or a string:dateform numbers 0, 1, 2, 6, 13, 14, 15, and 16 produce a string suitable for input to datenum or datevec. Other date string formats will not work with these functions.
Time formats like 'h:m:s', 'h:m:s.s', 'h:m pm', ... may also be part of the input array D. If you do not specify dateform, the date string format defaults to
D contains date information only (01-Mar-1995)
D contains time information only (03:45 PM)
D contains both date and time information (01-Mar-1995 03:45)
date Current date string
datenum Serial date number
datevec Date components