Skip to content

Converts a given time to the beginning or end of a time interval.

func.time_slice(<datetime>, INTERVAL <n> <unit>[, <boundary>])
func.time_slice('2024-06-15 14:35:00', text('INTERVAL 15 MINUTE'))
┌───────────────────────┐
│ '2024-06-15 14:30:00' │
└───────────────────────┘
TIME_SLICE(<datetime>, INTERVAL <n> <unit>[, <boundary>])
SELECT TIME_SLICE('2024-06-15 14:35:00', INTERVAL 15 MINUTE);
┌─────────────────────┐
│ 2024-06-15 14:30:00 │
└─────────────────────┘