How to convert from Unix timestamp to MySQL timestamp value?


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)

Updated on: 20-Jun-2020

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements