24.4. Creating a Timestamp from Microseconds (make_timestamp) #

The make_timestamp stored procedure creates a timestamp 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_timestamp(microseconds) ON CONFLICT DO NOTHING;

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

Postgres Pro AXE returns the created timestamp as a TIMESTAMP value.

Example 24.4. Executing the make_timestamp Stored Procedure

  SELECT make_timestamp(1640995200000000) AS new_years_2022;