Skip to content

Rounds the time to the half-hour.

func.time_slot(<expr>)
func.time_slot('2023-11-12 09:38:18.165575')
┌───────────────────────────────-───-───-──────┐
│ func.time_slot('2023-11-12 09:38:18.165575') │
│ Timestamp │
├─────────────────────────────────-───-────────┤
2023-11-12 09:30:00
└─────────────────────────────────-───-────────┘
time_slot(<expr>)
ArgumentsDescription
<expr>timestamp

TIMESTAMP, returns in “YYYY-MM-DD hh:mm:ss.ffffff” format.

SELECT
time_slot('2023-11-12 09:38:18.165575')
┌─────────────────────────────────────────┐
│ time_slot('2023-11-12 09:38:18.165575') │
Timestamp
├─────────────────────────────────────────┤
2023-11-12 09:30:00
└─────────────────────────────────────────┘