The UNIX_TIMESTAMP () and UNIX_TIMESTAMP (date) functions are used to convert dates in MySQL queries. The following describes how to use the date Format Conversion Function in MySQL queries, for your reference.
If no parameter is called, a Unix timestamp ('2017-01-01 00:00:00 'seconds after GMT) is returned as an unsigned integer. If you use date to call UNIX_TIMESTAMP (), it will return the parameter value in the form of the number of seconds after '2017-01-01 00:00:00 'GMT. Date can be a DATE string, a datetime string, a TIMESTAMP, or a number in the YYMMDD or YYYMMDD format of the local time.
Mysql> SELECT UNIX_TIMESTAMP ();
-> 882226357
Mysql> SELECT UNIX_TIMESTAMP ('2017-10-04 22:23:00 ');
-> 875996580
When UNIX_TIMESTAMP is used in the TIMESTAMP column, the function returns an internal timestamp value without any implicit conversion of "string-to-Unix-TIMESTAMP. If you pass an overflow date to UNIX_TIMESTAMP (), it returns 0, but note that only the basic range check will be executed (year from 1970 to 2037, month from 01 to 12, from 01 to 31 ).
The preceding section describes the Date Format Conversion Function in MySQL query.
Optimization instance for MySQL random Query
MySQL query cache Variables
Mysql Key_buffer_size parameter settings
Set the maximum number of connections on the MySQL server
Mysql multi-Table query implementation