1、时间转时间戳;
mysql> select unix_timestamp('2018-01-15 09:45:16'); +---------------------------------------+ | unix_timestamp('2018-01-15 09:45:16') | +---------------------------------------+ | 1515980716 | +---------------------------------------+ 1 row in set (0.00 sec)2、时间戳转时间
mysql> SELECT from_unixtime(1584524789); +------------------------------------------------+ | from_unixtime(1584524789) | +------------------------------------------------+ | 2018-01-15 09:45:16 | +------------------------------------------------+ 1 row in set (0.00 sec)