TO_SECONDS (Lakehouse v1)
Converts a specified number of seconds into an Interval type.
- Accepts positive integers, zero, and negative integers as input.
Analyze Syntax
Section titled “Analyze Syntax”func.to_seconds(<seconds>)Analyze Examples
Section titled “Analyze Examples”func.to_seconds(2)┌──────────────────────────────────────────────────────┐│ func.to_seconds(2) │├──────────────────────────────────────────────────────┤│ 0:00:02 │└──────────────────────────────────────────────────────┘SQL Syntax
Section titled “SQL Syntax”TO_SECONDS(<seconds>)Aliases
Section titled “Aliases”Return Type
Section titled “Return Type”Interval (in the format hh:mm:ss).
SQL Examples
Section titled “SQL Examples”SELECT TO_SECONDS(2), TO_SECONDS(0), TO_SECONDS((- 2));
┌─────────────────────────────────────────────────┐│ to_seconds(2) │ to_seconds(0) │ to_seconds(- 2) │├───────────────┼───────────────┼─────────────────┤│ 0:00:02 │ 00:00:00 │ -0:00:02 │└─────────────────────────────────────────────────┘