In MySQL, how can I convert a number of seconds into TIMESTAMP?

MySQLMySQLi Database

It is exactly reverse of UNIX_TIMESTAMP() and can be done with the help of FROM_UNIXTIME() function. For example, 11576070 seconds would be TIMESTAMP ‘1970-05-15 05:04:30’.

mysql> Select FROM_UNIXTIME(11576070);
+--------------------------------+
| FROM_UNIXTIME(11576070)        |
+--------------------------------+
|      1970-05-15 05:04:30       |
+--------------------------------+
1 row in set (0.00 sec)
raja
Published on 19-Feb-2018 07:03:36
Advertisements