Dates & time Scalar

epoch_us()

Extract the epoch component in microseconds from a temporal type

Arguments & returns

7 overloads

epoch_us(temporal)

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

Example

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

Engine example · Run to view results.

In other engines

BigQueryunix_micros()

SELECT UNIX_MICROS('2008-12-25 15:30:00+00')
In Haybarn
SELECT EPOCH_US(CAST('2008-12-25 15:30:00+00' AS TIMESTAMPTZ))

SQLGlot example ↗

Snowflake

SELECT EXTRACT(EPOCH_MICROSECOND FROM CAST('2026-01-06 11:45:00' AS TIMESTAMP_NTZ))
In Haybarn
SELECT EPOCH_US(CAST('2026-01-06 11:45:00' AS TIMESTAMP))

SQLGlot example ↗