| Financial Toolbox | Search  Help Desk |
| datestr | Examples See Also |
Syntax
ds = datestr(d, dateform) ds = datestr(d, dateform, p) ds = datestr(d)
Description
ds = datestr(d, dateform)
converts a date number or a date string d to a date string ds. dateform specifies the format of ds. Date strings with two-character years, e.g., 12-june-12, are assumed to lie within the 100-year period centered about the current year.
ds = datestr(d, dateform, p)
assumes that two-character years lie within the 100-year period beginning with the pivot year p . The default pivot year is the current year minus 50 years.
ds = datestr(d)
assumes dateform is 1, 16, or 0 depending on whether the date number d contains a date, time, or both, respectively. If d is a date string, the function assumes dateform is 1.Examples
ds = datestr(728798, 1)
ds = 19-May-1995
ds = datestr(728798, 2)
ds = 05/19/95
ds = datestr(728798, 12)
ds = May95
ds = datestr(728798.776, 0)
ds = 19-May-1995 18:37:26
ds = datestr('5/19', 1) (assuming the year is 1995)
ds = 19-May-1995
ds = datestr(728798)
ds = 19-May-1995
ds = datestr([728678 728709 728737 728768 728798 728829])
ds =
19-Jan-1995
19-Feb-1995
19-Mar-1995
19-Apr-1995
19-May-1995
19-Jun-1995
ds = datestr('5/19')
ds = 19-May-1995 (assuming the year is 1995)
See Also
dateaxis, datenum, datevec, daysact, now, today