Dates & time Scalar

epoch_ms()

Extract the epoch component in milliseconds from a temporal type

Arguments & returns

8 overloads

epoch_ms(temporal)

Scalar
Overload link temporal Returns
#01 BIGINT TIMESTAMP
#02 DATE BIGINT
#03 INTERVAL BIGINT
#04 TIME BIGINT
#05 TIME WITH TIME ZONE BIGINT
#06 TIME_NS BIGINT
#07 TIMESTAMP BIGINT
#08 TIMESTAMP WITH TIME ZONE BIGINT

Example

epoch_ms example
SQL
Haybarn WASM 1.5.5-rc3 · In your browser

Engine example · Run to view results.

In other engines

BigQueryunix_millis()

SELECT UNIX_MILLIS('2008-12-25 15:30:00+00')
In DuckDB
SELECT EPOCH_MS(CAST('2008-12-25 15:30:00+00' AS TIMESTAMPTZ))

SQLGlot example ↗

Snowflakedate_part()

SELECT DATE_PART(epoch_milliseconds, foo) as ddate from table_name
In DuckDB
SELECT EPOCH_MS(foo) AS ddate FROM table_name

SQLGlot example ↗