Scalar function
NULL or unparseable input returns NULL in the single-value parsing form. A NULL format or invalid argument can raise an error. The numeric-scale form requires the constant, non-NULL arguments described above.
Syntax
Scalar
- NULL explicit format raises an error; TRY does not suppress this argument error.
Scaled (scalar)
- Use integer epoch values and a constant BIGINT scale; floating-point and decimal operands can select string-format handling instead of epoch scaling.
- Integer division by 10^scale discards the subsecond remainder.
- Both arguments must be constants. Numeric columns can raise an argument error, including with TRY variants.
Arguments
Scalar
Scaled
Returns
- Type: TIMESTAMP (microsecond precision, no timezone)
- NULL behavior: NULL or unparseable input returns NULL in the single-value parsing form. A NULL format or invalid argument can raise an error. The numeric-scale form requires the constant, non-NULL arguments described above.
Properties
Usage notes
- These forms use the non-ANSI parsing rules of TO_TIMESTAMP_NTZ.
- A trailing timezone offset is removed to preserve wall-clock time instead of normalizing to UTC.
- The two-numeric-argument form divides by 10^scale before converting whole seconds to microseconds; subsecond remainders are currently discarded.
- INTEGER and INT mean the same type; STRING means VARCHAR text. NULL can be used with a supported type. Cast NULL explicitly when its type would otherwise be unclear.
- Deterministic: The same inputs and settings produce the same result.
Examples
Typical behavior
Valid text and invalid text
Limitations
- Format handling and numeric epoch-unit inference follow TO_TIMESTAMP_NTZ; unsupported combinations can fail during planning.
- The scaled form requires the constant integer arguments described above. Cast FLOAT, DOUBLE, or DECIMAL values to BIGINT explicitly before using them as epoch units.
Last modified on October 15, 2026