Skip to main content
Scalar function
Returns NULL for NULL input. Non-finite numeric values or arithmetic overflow raise an error.

Syntax

Scalar

Arguments

Returns

  • Type: TIMESTAMP with UTC timezone
  • Possible values: UTC instants representable as signed 64-bit microseconds.
  • NULL behavior: Returns NULL for NULL input. Non-finite numeric values or arithmetic overflow raise an error.

Properties

Units

  • Input unit: seconds since Unix epoch UTC
  • Output unit: UTC timestamp with microsecond precision
  • Multiply by 1000000 to obtain microseconds.

Usage notes

  • Negative inputs represent instants before the Unix epoch.
  • Conversion results must fit a signed 64-bit count of microseconds; overflow raises an error.
  • Floating-point values are truncated toward zero after multiplication to microseconds. Non-finite floats are rejected.
  • Decimal input is rounded to the nearest microsecond with halfway values away from zero.

Examples

Unix epoch conversion

NULL input

Limitations

  • INTEGER, BIGINT, FLOAT, DOUBLE, and DECIMAL inputs are supported. Fractional seconds follow the rounding rules in Usage notes.
  • TINYINT and SMALLINT inputs are not accepted directly. Cast them to INTEGER first.
Last modified on October 15, 2026