Date to String | DATE_TO_STRING
Syntax
DATE_TO_STRING( [value], [formatMask] )
Parameters
value
The date value that will be converted to a string. If the value is not a DATE object, it will be converted to one with the DATE
method.
formatMask optional
A string describing the format for the conversion.
Valid formats include:
- "ddd mmm dd yyyy HH:MM:ss"
- "m/d/yy"
- "m/d/yyyy"
- "mm/dd/yy"
- "mm/dd/yyyy"
- "d/m/yy"
- "d/m/yyyy"
- "dd/mm/yy"
- "dd/mm/yyyy"
- "mmm d, yyyy"
- "mmmm d, yyyy"
- "dddd, mmmm d, yyyy"
- "h:MM TT"
- "h:MM:ss TT"
- "h:MM:ss TT Z"
- "yyyy-mm-dd"
- "HH:MM:ss"
- "yyyy-mm-dd'T'HH:MM:ss"
- "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"
Return Value
The result of the input being formatted to a string value.Description
Converts a date to a string representation according to a specified format.Examples
DATE_TO_STRING(DATE("2017-08-30T17:36:23.077Z"), "UTC:ddd mmm dd yyyy HH:MM:ss") # outputs "Wed Aug 30 2017 17:36:23"
DATE_TO_STRING(DATE("2017-08-30T17:36:23.077Z"), "UTC:mm/dd/yyyy") # outputs "08/30/2017"