Топ-100
 

FROM_UNIXTIME

База данных: MySQL
Текст

Syntax:
FROM_UNIXTIME(unix_timestamp[,format])

Returns a representation of the unix_timestamp argument as a value in
'YYYY-MM-DD hh:mm:ss' or YYYYMMDDhhmmss format, depending on whether
the function is used in a string or numeric context. unix_timestamp is
an internal timestamp value representing seconds since '1970-01-01
00:00:00' UTC, such as produced by the UNIX_TIMESTAMP() function.

The return value is expressed in the session time zone. (Clients can
set the session time zone as described in
https://dev.mysql.com/doc/refman/8.0/en/time-zone-support.html.) The
format string, if given, is used to format the result the same way as
described in the entry for the DATE_FORMAT() function.

URL: https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html

Пример

mysql> SELECT FROM_UNIXTIME(1447430881);
-> '2015-11-13 10:08:01'
mysql> SELECT FROM_UNIXTIME(1447430881) + 0;
-> 20151113100801
mysql> SELECT FROM_UNIXTIME(1447430881,
-> '%Y %D %M %h:%i:%s %x');
-> '2015 13th November 10:08:01 2015'