Skip to content

Converts a date with time (timestamp/datetime) to a UInt8 number containing the number of the second in the minute (0-59).

func.to_second(<expr>)
func.to_second('2023-11-12 09:38:18.165575')
┌──────────────────────────────────────────────┐
│ func.to_second('2023-11-12 09:38:18.165575') │
│ UInt8 │
├──────────────────────────────────────────────┤
18
└──────────────────────────────────────────────┘
TO_SECOND(<expr>)
ArgumentsDescription
<expr>timestamp

TINYINT

SELECT
to_second('2023-11-12 09:38:18.165575')
┌─────────────────────────────────────────┐
│ to_second('2023-11-12 09:38:18.165575') │
│ UInt8 │
├─────────────────────────────────────────┤
18
└─────────────────────────────────────────┘