How to extract just the hour from Timestamp in BigQuery?
\n\nTo extract just the hour of a timestamp using standard SQL?
\n\nYou can use EXTRACT
(HOUR FROM your-timestamp-column)
for example:
\n\nSELECT EXTRACT(HOUR FROM CURRENT_TIMESTAMP()) \n
\n\nor
\n\nSELECT EXTRACT(HOUR FROM TIMESTAMP '2018-07-09T02:40:23.652Z')\n
\n\nor
\n\nSELECT EXTRACT(HOUR FROM TIMESTAMP('2018-07-09T02:40:23.652Z'))\n
David-Spring
posted onEnjoy great content like this and a lot more !
Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds
Post Comment