Skip to main content

FROM_MILLISECOND

Description​

The function converts a Unix timestamp (in milliseconds) into a DATETIME value.

Syntax​

FROM_MILLISECOND(<millisecond>)

Parameters​

ParameterDescription
<millisecond>Required. The Unix timestamp representing the number of milliseconds elapsed since 1970-01-01 00:00:00 UTC.

Return Value​

  • Returns a DATETIME value representing the date and time corresponding to the given Unix timestamp.
  • If is NULL, the function returns NULL.
  • If is out of valid range, the function returns an error.

Example​

SELECT FROM_MILLISECOND(1700000000000);
+---------------------------------+
| from_millisecond(1700000000000) |
+---------------------------------+
| 2023-11-15 06:13:20 |
+---------------------------------+