formatDate
Returns the date as a string formatted according to specification.
Example
Format December 24, 2001 23:55:12.000 in the MMM-dd-yyyy format.
formatDate(timestamp("2001-12-24 23:55:12.000"), "MMM-dd-yyyy")This example returns Dec-24-2001.
Syntax
formatDate(timestamp expr t, format)- t: expression evaluating to a
timestamptype -
format:
stringdescribing the format of the outputReturns
string
Notes
formatDate takes a timestamp and format string and returns a string corresponding to that date, in the format specified by the string.
Symbols allowed in the format string are:
- y - year
- M - month
- d - day
- m - minutes
- s - seconds