Skip to main content

TO_SECOND

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

Syntax

TO_SECOND(<expr>)

Arguments

ArgumentsDescription
<expr>timestamp

Return Type

TINYINT

Examples

SELECT
to_second('2023-11-12 09:38:18.165575');

┌─────────────────────────────────────────┐
│ to_second('2023-11-12 09:38:18.165575')
├─────────────────────────────────────────┤
18
└─────────────────────────────────────────┘
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today