Scalar function
A constant NULL seconds value returns NULL. In the form without a format, NULL values in a seconds column may not remain NULL. The formatted form preserves NULL seconds values.
Syntax
Timestamp (scalar)
Arguments
Timestamp
Returns
- Type: TIMESTAMP with UTC timezone when format is omitted; STRING when format is provided
- NULL behavior: A constant NULL seconds value returns NULL. In the form without a format, NULL values in a seconds column may not remain NULL. The formatted form preserves NULL seconds values.
- Type: STRING
- NULL behavior: NULL scalar seconds or NULL format yields NULL.
Properties
Units
- Input unit: Epoch seconds UTC
- Output unit: UTC timestamp or formatted text
- Seconds * 1000000 -> microseconds.
Usage notes
- Epoch seconds multiply by 1000000 for microsecond timestamps.
Examples
Basic example
Seconds after the epoch
This result uses UTC.
Limitations
- Query tools may report TIMESTAMP for both forms. The formatted form returns STRING and is not automatically converted to TIMESTAMP.
- In the form without a format, NULL values in a seconds column may incorrectly produce non-NULL results.
- Seconds must be within [-9223372036854, 9223372036854]. Larger magnitudes overflow; an error or NULL result is not guaranteed.
Last modified on October 15, 2026