Back to Playground Home

Bucket timestamp (epoch millis) to 15 minutes granularity

SELECT timestamp_field,
       cast(timestamp_field AS long) AS timeInMs,
       DATETIMECONVERT(
         timestamp_field, 
         '1:MILLISECONDS:EPOCH', 
         '1:MILLISECONDS:EPOCH', 
         '15:MINUTES'
       ) AS convertedTime
FROM users