Home > Database > Mysql Tutorial > body text

How to convert Unix timestamp to MySQL timestamp value?

WBOY
Release: 2023-09-04 23:49:05
forward
1058 people have browsed it

如何将 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)
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template