Skip to content

Converts a given time to the beginning or end of a time interval based on the specified period.

func.date_slice(<datetime>, INTERVAL <n> <unit>[, <boundary>])
func.date_slice('2024-06-15 14:35:00', text('INTERVAL 1 HOUR'))
┌───────────────────────┐
'2024-06-15 14:00:00'
└───────────────────────┘
DATE_SLICE(<datetime>, INTERVAL <n> <unit>[, <boundary>])
SELECT DATE_SLICE('2024-06-15 14:35:00', INTERVAL 1 HOUR);
┌─────────────────────┐
2024-06-15 14:00:00
└─────────────────────┘