FROM_UNIXTIME(unix_timestamp), FROM_UNIXTIME(unix_timestamp,format) : FROM_UNIXTIME : Date Time Functions MySQL TUTORIALS


MySQL TUTORIALS » Date Time Functions » FROM_UNIXTIME »

 

FROM_UNIXTIME(unix_timestamp), FROM_UNIXTIME(unix_timestamp,format)


Returns a 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.

The value is expressed in the current time zone.

mysql>
mysql>
mysql> SELECT FROM_UNIXTIME(875996580);
+--------------------------+
| FROM_UNIXTIME(875996580|
+--------------------------+
1997-10-04 13:23:00      |
+--------------------------+
row in set (0.00 sec)

mysql> SELECT FROM_UNIXTIME(8759965800;
+------------------------------+
| FROM_UNIXTIME(875996580|
+------------------------------+
|        19971004132300.000000 |
+------------------------------+
row in set (0.00 sec)

mysql> SELECT FROM_UNIXTIME(UNIX_TIMESTAMP(),'%Y %D %M %h:%i:%s %x');
+--------------------------------------------------------+
| FROM_UNIXTIME(UNIX_TIMESTAMP(),'%Y %D %M %h:%i:%s %x') |
+--------------------------------------------------------+
2007 22nd July 07:46:11 2007                           |
+--------------------------------------------------------+
row in set (0.00 sec)

mysql>



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Date Time Functions
» FROM_UNIXTIME