- Categories:
Semi-structured and structured data functions (Type Predicates)
IS_TIMESTAMP_*¶
Verifies whether a VARIANT argument contains the respective timestamp value:
IS_TIMESTAMP_LTZ (value with local time zone).
IS_TIMESTAMP_NTZ (value with no time zone).
IS_TIMESTAMP_TZ (value with time zone).
- See also:
Syntax¶
Arguments¶
variant_exprAn expression that evaluates to a value of type VARIANT.
Returns¶
Returns a BOOLEAN value or NULL.
Returns TRUE if the VARIANT value contains a timestamp. Otherwise, returns FALSE.
If the input is NULL, returns NULL without reporting an error.
Examples¶
Show all timestamps in a VARIANT column, with the output using the time zone specified for the session.
Note
The output format for the time zone is set using a parameter:
The TIMESTAMP_LTZ_OUTPUT_FORMAT parameter sets the format for TIMESTAMP_LTZ values.
The TIMESTAMP_NTZ_OUTPUT_FORMAT parameter sets the format for TIMESTAMP_NTZ values.
The TIMESTAMP_TZ_OUTPUT_FORMAT parameter sets the format for TIMESTAMP_TZ values.
In these examples, the local time zone is US Pacific Standard Time (-08:00 relative to GMT/UCT).
Create and load a table with various date and time values in a VARIANT column:
Use the TYPEOF function in a query to show the data types of the values stored in the VARIANT column v:
Show the TIMESTAMP_NTZ values in the data by using the IS_TIMESTAMP_NTZ function in a WHERE clause:
Show the TIMESTAMP_LTZ values in the data by using the IS_TIMESTAMP_LTZ function in a WHERE clause:
Show the TIMESTAMP_TZ values in the data by using the IS_TIMESTAMP_TZ function in a WHERE clause: