Dates & time Scalar

epoch_ns()

Extract the epoch component in nanoseconds from a temporal type

Arguments & returns

8 overloads

epoch_ns(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
#08 TIMESTAMP_NS BIGINT

Example

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

Engine example · Run to view results.

In other engines

Snowflakedatediff()

DATEDIFF(NANOSECOND, start_time, end_time)
In Haybarn
EPOCH_NS(CAST(end_time AS TIMESTAMP_NS)) - EPOCH_NS(CAST(start_time AS TIMESTAMP_NS))

SQLGlot example ↗