EXTRACT_TIMESTAMP
Convert a date or timestamp string to a date or timestamp, autodetecting the date format.
Syntax
Arguments
Name | Type | Description | Default Value |
---|---|---|---|
datetime | string | Convert a date or timestamp string to a date or timestamp, autodetecting the date format. |
Returns
timestamp
Examples
datetime | Output |
---|---|
'2017-09-25 22:11:00' | timestamp '2017-09-25 22:11:00' |
'2017-09-25T22:11:12Z' | timestamp '2017-09-25 22:11:12' |
'2017-09-25T22:11:12.1Z' | timestamp '2017-09-25 22:11:12.100' |
'2017-09-25T22:11:12.12Z' | timestamp '2017-09-25 22:11:12.120' |
'2017-09-25T22:11:12.123Z' | timestamp '2017-09-25 22:11:12.123' |
'2018-03-19' | timestamp '2018-03-19 00:00:00' |
'2018_Mar_21_17:59:05.689' | timestamp '2018-03-21 17:59:05.689' |
'2018_Mar_21' | timestamp '2018-03-21 00:00:00' |
'2018_Mar_21_00:59:05.689 America/Los_Angeles' | timestamp '2018-03-21 07:59:05.689' |
'March 21, 2018 00:59:05.689 America/Los_Angeles' | timestamp '2018-03-21 07:59:05.689' |
'03/21/2020 00:59:05.689' | timestamp '2020-03-21 00:59:05.689' |
'03/11/2020 00:59:05.689 America/Los_Angeles' | timestamp '2020-03-11 07:59:05.689' |
'03/11/2020 00:59:05.689 America/Los_Angeles' | timestamp '2020-03-11 07:59:05.689' |
'21/11/2020 00:59:05.689 America/Los_Angeles' | timestamp '2020-11-21 08:59:05.689' |
'https://www.zillow.com/homedetails/33-Rohde-Ave-St-Augustine-FL-32084/2099072901_zpid/' | timestamp '2099-07-29 01:00:00' |
Transformation job example
SQL
Query result
datetime | Output |
---|---|
'2017-09-25 22:11:00' | timestamp '2017-09-25 22:11:00' |
Last updated