24.5. Creating a Timestamp with Time Zone from Microseconds (make_timestamptz) #

The make_timestamptz stored procedure creates a timestamp with time zone from the number of microseconds since the Unix epoch. The Unix epoch is 1970-01-01 00:00:00 UTC.

Required privileges: Postgres Pro AXE administrator only. For a full list of stored procedures and privileges, refer to Section 12.1.

Execute the following command on the Postgres Pro AXE server:

  SELECT make_timestamptz(microseconds) ON CONFLICT DO NOTHING;

Where microseconds is the number of microseconds since the Unix epoch.

Postgres Pro AXE returns the created timestamp with time zone as a TIMESTAMPTZ value.

Example 24.5. Executing the make_timestamptz Stored Procedure

  SELECT make_timestamptz(1640995200000000) AS new_years_2022_tz;