在MySQL中,UNIX时间戳格式是将时间值表示为整数的方式。日期值表示的整数值将是秒数。计算这些秒数的开始日期是“ 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值是10位数字。