24.4. Создание временной метки из микросекунд (make_timestamp) #

Хранимая процедура make_timestamp создаёт временную метку на основе количества микросекунд, прошедших с эпохи Unix. Эпоха Unix — это 1970-01-01 00:00:00 UTC.

Требуемые права: только администратор Postgres Pro AXE. За полным списком хранимых процедур и прав обратитесь к Разделу 12.1.

Выполните следующую команду на сервере Postgres Pro AXE:

  SELECT make_timestamp(микросекунды);

Где микросекунды — это количество микросекунд, прошедших с эпохи Unix.

Postgres Pro AXE возвращает созданную временную метку в виде значения TIMESTAMP.

Пример 24.4. Выполнение хранимой процедуры make_timestamp

  SELECT make_timestamp(1640995200000000) AS new_years_2022;

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);

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;

FAQ