abhishek jha
abhishek jha

Reputation: 1095

How to convert timestamp to seconds in BigQuery Standard SQL

In BigQuery Legacy Sql, we use timestamp_to_sec() function to convert timestamp to seconds. What is its equivalent in BigQuery Standard SQL?

Upvotes: 9

Views: 17451

Answers (1)

Mikhail Berlyant
Mikhail Berlyant

Reputation: 173190

BigQuery Legacy SQL

SELECT TIMESTAMP_TO_SEC(CURRENT_TIMESTAMP()) 

BigQuery Standard SQL

SELECT UNIX_SECONDS(CURRENT_TIMESTAMP())

Upvotes: 17

Related Questions