Home > Database > Mysql Tutorial > body text

In MySQL, how do we represent time values ​​as integers?

王林
Release: 2023-09-18 14:33:03
forward
588 people have browsed it

In MySQL, how do we represent time values ​​as integers?

In MySQL, the UNIX timestamp format is a way of representing time values ​​as integers. The integer value representing the date value will be the number of seconds. The starting date for calculating these seconds is "1970-01-01".

mysql> SELECT UNIX_TIMESTAMP('2017-10-22 04:05:36')AS 'Total Number of Seconds';
+-------------------------+
| Total Number of Seconds |
+-------------------------+
|              1508625336 |
+-------------------------+
1 row in set (0.00 sec)
Copy after login

UNIX_TIMESTAMP value is 10 bits long.

The above is the detailed content of In MySQL, how do we represent time values ​​as integers?. 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!