1, query the current time of month and day seconds
Mysql> Select Now (); +---------------------+| Now () 2018-03-19 23:12:52 |+---------------------+
2. Check the time of three hours before the current time
Subdate (now (), Interval 3 hour); +--------------------------------+| Subdate (now (), Interval 3 hour) |+--------------------------------+| 2018-03-19 20:13:11 |+--------------------------------+
3. Check the time of three days before the current time
Mysql> Select Subdate (now (), Interval 3 day ); +-------------------------------+| Subdate (now (), Interval 3 day) |+-------------------------------+| 2018-03-16 23:13:23 |+-------------------------------+
4, check the new current time three minutes before the point of time
Mysql> Select Subdate (now (), Interval 3 minute); +----------------------------------+| Subdate (now (), Interval 3 minute) |+----------------------------------+| 2018-03-19 23:10:32 |+----------------------------------+
5, query the current time of the second
Mysql>current_time (); +----------------+| Current_time () |+----------------+| 23:14:09 |+----------------+
6, query the current time of month and day seconds
Mysql>current_date (); +----------------+| Current_date () |+----------------+| 2018-03-19 |+----------------+
MySQL Database time query