FROM_UNIXTS, FROM_UNIXTSMS¶
Converts a BIGINT
representing a UNIX timestamp to a DATETIME
value.
Syntax¶
FROM_UNIXTS( expr ) --> DATETIME
FROM_UNIXTSMS( expr ) --> DATETIME
Arguments¶
Parameter |
Description |
---|---|
|
An integer containing a UNIX timestamp in seconds/milliseconds from EPOCH |
Returns¶
FROM_UNIXTS
returns aDATETIME
from a UNIX timestamp in seconds since EPOCHFROM_UNIXTSMS
returnsDATETIME
from a UNIX timestamp in milliseconds since EPOCH.
Notes¶
To convert a DATETIME
to a UNIX timestamp, see TO_UNIXTS.
Examples¶
Convert a UNIX timestamp to DATETIME
¶
master=> SELECT FROM_UNIXTS(0), FROM_UNIXTS(1575636057);
to_unixtsms | to_unixts
--------------+-----------
1575642811562 | 1575642811