FORMAT_DATETIME
Converts a datetime value into a string.
Syntax
Arguments
Name | Type | Description | Default Value |
---|---|---|---|
datetime | timestamp | A datetime value. | |
format | string | A format string that is compatible with JodaTime’s pattern: http://joda-time.sourceforge.net/apidocs/org/joda/time/format/DateTimeFormat.html |
Examples
datetime | format | Output |
---|---|---|
timestamp '2017-09-25 22:11:00' | 'yyyy/MM/dd HH:mm:ss.SSS' |
|
timestamp '2018-03-10 08:12:45' | 'yyyy/MM/dd' |
|
timestamp '2019-10-20 08:55:12.450' | 'HH:mm:ss.SS' |
|
timestamp '2018-03-10 08:55:12.450' | 'E' |
|
Transformation job example
SQL
Query result
datetime | format | Output |
---|---|---|
timestamp '2017-09-25 22:11:00' | 'yyyy/MM/dd HH:mm:ss.SSS' |
|
Last updated