TO_UNIX_TIMESTAMP (Lakehouse v1)
Converts a timestamp in a date/time format to a Unix timestamp format. A Unix timestamp represents the number of seconds that have elapsed since January 1, 1970, at 00:00:00 UTC.
Analyze Syntax
Section titled “Analyze Syntax”func.to_unix_timestamp(<expr>)Analyze Examples
Section titled “Analyze Examples”func.to_unix_timestamp('2023-11-12 09:38:18.165575')
┌────────────────────────────────────────────────────────────────┐│ func.to_unix_timestamp('2023-11-12 09:38:18.165575') ││ UInt32 │├────────────────────────────────────────────────────────────────┤│ 1699781898 │└────────────────────────────────────────────────────────────────┘SQL Syntax
Section titled “SQL Syntax”TO_UNIX_TIMESTAMP(<expr>)Arguments
Section titled “Arguments”| Arguments | Description |
|---|---|
<expr> | Timestamp |
For more information about the timestamp data type, see Date & Time.
Return Type
Section titled “Return Type”BIGINT
SQL Examples
Section titled “SQL Examples”SELECT to_unix_timestamp('2023-11-12 09:38:18.165575')
┌─────────────────────────────────────────────────┐│ to_unix_timestamp('2023-11-12 09:38:18.165575') ││ UInt32 │├─────────────────────────────────────────────────┤│ 1699781898 │└─────────────────────────────────────────────────┘