In MySQL, The UNIX_TIMESTAMP function is used. In MySQL, The UNIX_TIMESTAMP function has two types for calling. 1. No parameter call: UNIX_TIMESTAMP (). Return Value: example of the number of seconds difference from '2014-01-01 00:00:00 'to the current time: SELECT UNIX_TIMESTAMP () => 1970 2 has a parameter call: UNIX_TIMESTAMP (date) here, date can be a DATE string, a datetime string, a TIMESTAMP, a local time in the YYMMDD or YYYMMDD format. The return value is: example of the difference in seconds between '2017-01-01 00:00:00 'and the specified time: www.2cto.com DATE string format: (DATE type) SELECT UNIX_TIMESTAMP ('2017-06-08 ') => 1339084800 SELECT UNIX_TIMESTAMP (CURRENT_DATE () => 1339084800 note: the return value of CURRENT_DATE () is the same as that of a DATE string in the following formats: SELECT UNIX_TIMESTAMP ('20140901 '); SELECT UNIX_TIMESTAMP ('2017-6-8 '); SELECT UNIX_TIMESTAMP ('2017-06-08'); the result is: 2012 DATETIME string format: (combination type of date and time) SELECT UNIX_TIMESTAMP ('2017-06-08 10:48:55 ') => 2012 SELECT UNIX_TIMESTAMP (NOW () => 1339123415 note: the return value of NOW () is a DATETIME string format author MarcoFly