SELECTUNIX_TIMESTAMP('2017-10-2204:05:36')AS'TotalNumberofSeconds';+-------------------------+|TotalNumberofSeconds |+---------------------"/> SELECTUNIX_TIMESTAMP('2017-10-2204:05:36')AS'TotalNumberofSeconds';+-------------------------+|TotalNumberofSeconds |+---------------------">

Home >Database >Mysql Tutorial >In MySQL, how do we represent time values ​​as integers?

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

王林
王林forward
2023-09-18 14:33:03617browse

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)

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!

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