Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to:
Databricks Runtime 19 and above
Important
This feature is in Beta.
Returns the number of nanoseconds since 1970-01-01 00:00:00 UTC.
To enable nanosecond-precision timestamps, see TIMESTAMP type.
Syntax
unix_nanos(expr)
Arguments
expr: ATIMESTAMP_LTZ(p)orTIMESTAMP_NTZ(p)expression, wherepis from7through9.
Returns
A DECIMAL(21, 0).
Examples
> SELECT unix_nanos(TIMESTAMP'1970-01-01 00:00:01.123456789Z');
1123456789