SELECTUNIX_TIMESTAMP('2017-10-2204:05:36')AS'TotalNumberofSeconds';+-------------------------+|TotalNumberofSeconds |+---------------------"/> SELECTUNIX_TIMESTAMP('2017-10-2204:05:36')AS'TotalNumberofSeconds';+-------------------------+|TotalNumberofSeconds |+---------------------">
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!