to_timestamp_ntz function
Applies to: Databricks SQL
Databricks Runtime
Returns expr cast to a timestamp without a time zone using optional formatting.
Syntax
to_timestamp_ntz(expr [, fmt] )
Arguments
expr: ASTRING,DATE, orTIMESTAMPexpression that represents a timestamp.- fmt: An optional format
STRINGexpression.
Returns
If you omit fmt, the function is a synonym for cast(expr AS TIMESTAMP_NTZ).
If fmt is malformed or doesn't produce a well-formed timestamp, Databricks raises an error.
Common error conditions
Examples
SQL
> SELECT to_timestamp_ntz('2016-12-31 00:12:00');
2016-12-31 00:12:00
> SELECT to_timestamp_ntz('2016-12-31', 'yyyy-MM-dd');
2016-12-31 00:00:00