top of page
CerebroSQL

MySQL: 

FROM_UNIXTIME

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. The
format string, if given, is used to format the result the same way as
described in the entry for the DATE_FORMAT() function.

Example

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'

bottom of page