How to convert from Unix timestamp to MySQL timestamp value?

MySQLMySQLi Database

MySQL converts Unix timestamp to timestamp data type value with the help of  FROM_UNIXTIME() function.

Example

mysql> Select FROM_UNIXTIME(1508622563);
+-----------------------------+
| FROM_UNIXTIME(1508622563)   |
+-----------------------------+
| 2017-10-22 03:19:23         |
+-----------------------------+
1 row in set (0.00 sec)
raja
Updated on 20-Jun-2020 06:35:33

Advertisements