Home >Database >Mysql Tutorial >How to convert seconds to TIMESTAMP in MySQL?

How to convert seconds to TIMESTAMP in MySQL?

WBOY
WBOYforward
2023-09-10 20:09:08878browse

在 MySQL 中,如何将秒数转换为 TIMESTAMP?

It is completely opposite to UNIX_TIMESTAMP() and can be accomplished 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)

The above is the detailed content of How to convert seconds to TIMESTAMP in MySQL?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete