datestr
Format a date as a string.
Syntax
Section titled “Syntax”str = datestr(N)str = datestr(V)str = datestr(N, format)Description
Section titled “Description”Returns a string representation of the date specified by N (serial date number), V (date vector), or S (date string). The optional format is either an integer (preset format ID) or a string (custom format like 'yyyy-mm-dd HH:MM:SS').
Examples
Section titled “Examples”datestr(now) % '28-Apr-2026 13:25:51'datestr(now, 'yyyy-mm-dd') % '2026-04-28'