FROM_UNIXTIME()
FROM_UNIXTIME(unix
_timestamp
[,format
])
Returns the unix_timestamp
parameter
as a string in either YYY-MM-DD, HH:MM:SS, or YYYMMDDHHMMSS.uuuuuu
format, depending on whether the function is used in a string or
numeric context. If the optional format
parameter is provided, the result is formatted according to the
specifiers in Table 8-11.
This code returns the strings “2000-01-01 00:00:00” and “Saturday
January 1st 2000 12:00 AM”:
SELECT FROM_UNIXTIME(946684800); SELECT FROM_UNIXTIME(946684800, '%W %M %D %Y %h:%i %p');