Syntax
FROM_UNIXTIME(unix_timestamp)
FROM_UNIXTIME(unix_timestamp, format)
Purpose
You can call this function to return a value based on the following rules:
If
formatis not specified, a value of theDATETIMEtype is returned, regardless of the time zone.If
formatis specified, a date and time string in the specified format is returned.
unix_timestamp refers to the UNIX timestamp, which indicates the number of microseconds from 1970-01-01 00:00:00.000000.
For more information about the formats supported by format, see DATE_FORMAT.
Examples
obclient> SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(), '%Y %D %M %h:%i:%s %x');
+---------------------------------------------------------+
FROM_UNIXTIME(UNIX_TIMESTAMP(), '%Y %D %M %h:%i:%s %x')
+---------------------------------------------------------+
2018 5th May 08:41:26 2018
+---------------------------------------------------------+
1 row in set (0.01 sec)