Home  >  Article  >  Database  >  How to convert Unix timestamp to MySQL timestamp value?

How to convert Unix timestamp to MySQL timestamp value?

WBOY
WBOYforward
2023-09-04 23:49:051050browse

如何将 Unix 时间戳转换为 MySQL 时间戳值?

MySQL converts a Unix timestamp to a timestamp data type value with the help of the 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)

The above is the detailed content of How to convert Unix timestamp to MySQL timestamp value?. 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