9
votes

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

1

1 Answers

12
votes

BigQuery Legacy SQL

SELECT TIMESTAMP_TO_SEC(CURRENT_TIMESTAMP()) 

BigQuery Standard SQL

SELECT UNIX_SECONDS(CURRENT_TIMESTAMP())