Skip to content

datestr

time · scripts/time/datestr.m

: s = datestr (d)
: s = datestr (d, fmt)
: s = datestr (d, fmt, pivot)

Format dates as text, one row of the result per date.

d may be an array of serial date numbers, an m-by-3 or m-by-6 matrix of date vectors, or date strings. fmt is either a format number from 0 to 31 or a string of tokens such as yyyy-mm-dd HH:MM:SS. Without a format, dd-mmm-yyyy is used if every time of day is midnight and dd-mmm-yyyy HH:MM:SS otherwise.