arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

ToEpochRounded

This section contains reference documentation for the toEpochRounded functions.

Convert epoch milliseconds to epoch , round to nearest rounding bucket(Bucket size is defined in ) The following time units are supported:

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

hashtag
Signature

ToEpoch<TIME_UNIT>Rounded(timeInMillis, bucketSize)

hashtag
Usage Examples

epochSeconds
epochMins
epochHours
epochDays

1613472000

26891200

448185

18670

select ToEpochSecondsRounded(1613472303000, 1000) AS epochSeconds
FROM ignoreMe
select ToEpochMinutesRounded(1613472303000, 10) AS epochMins
FROM ignoreMe
select ToEpochHoursRounded(1613472303000, 5) AS epochHours
FROM ignoreMe
select ToEpochDaysRounded(1613472303000, 10) AS epochDays
FROM ignoreMe