yongsheng
yongsheng

Reputation: 396

Google BigQuery - parse_timestamp

Having a difficult time parsing this particular expression:

'2021-01-06 01:16:04.0880000 +00:00'

I have tried the below whole consulting the docs for timestamp:

select parse_timestamp('%Y-%m-%d %H:%M:%S.%E*S %Ez', '2021-01-06 01:16:04.0880000 +00:00')

Any help would be appreciated, thank you

Upvotes: 2

Views: 1162

Answers (1)

Sebastian Brosch
Sebastian Brosch

Reputation: 43574

The %E*S also includes the seconds (%S) so you can use the following instead:

SELECT PARSE_TIMESTAMP('%Y-%m-%d %H:%M:%E*S %Ez', '2021-01-06 01:16:04.0880000 +00:00')
-- Output: 2021-01-06 01:16:04.088 UTC

Upvotes: 2

Related Questions