Mysql date comparison statement select * from student where '2017-02-27 00:00:00 '<created_date and '2017-02-29 00:00:00'> created_date select * from student where UNIX_TIMESTAMP ('2017-2012- 02-27 00:00:00 ') <UNIX_TIMESTAMP (created_date) and UNIX_TIMESTAMP ('2017-02-29 00:00:00 ')> UNIX_TIMESTAMP (created_date); www.2cto.com SELECT * FROM student WHERE (UNIX_TIMESTAMP (created_date) -UNIX_TIMESTAMP ('2017-02-26 00:00:00 ')) > = 0 AND (UNIX_TIMESTAMP (created_date)-UNIX_TIMESTAMP ('2017-02-29 00:00:00 ') <= 0 The unix_timestamp function for MySql time comparison can accept a parameter, you can also choose not to use parameters. The return value is an unsigned integer. If the parameter is not used, it returns the number of seconds that have elapsed since 00:00:00, January 1, January 1, 1970. If the parameter is used, the parameter type is time or time string representation, it is the number of seconds that have elapsed since 00:00:00 to the specified time.
With this function, you can naturally convert the time comparison into a comparison of unsigned integers. For example, determine whether a time is in a single interval unix_timestamp (time) between unix_timestamp ('start') and unix_timestamp ('end ')