Back to Playground Home

Convert timestamp (epoch millis) to Date Time string format, bucketed at 1 day granularity

SELECT timestamp_field,
       DATETIMECONVERT(
         timestamp_field, 
         '1:MILLISECONDS:EPOCH', 
         '1:DAYS:SIMPLE_DATE_FORMAT:yyyy-MM-dd', 
         '1:DAYS'
       ) AS convertedTime
FROM users