First, check the current time
Now function
Mysql> Select Now (); +---------------------+| Now () |+---------------------+| 2016-04-29 22:04:42 |+---------------------+1 row in Set (0.00 sec)
Second, the time to get the string format through Unix time
From_unixtime function
Mysql> Select From_unixtime (1461938772); +---------------------------+| From_unixtime (1461938772) |+---------------------------+| 2016-04-29 22:06:12 |+---------------------------+1 row in Set (0.17 sec)
Application:
Select From_unixtime (clock) As date, UserID, action, IP, resourcename from auditlog where clock>%s; "% Yest_clock
Note: Linux gets the current Unix time date +%s
Three
This article is from the "Tridewah operation and maintenance work Road" blog, please be sure to keep this source http://cuidehua.blog.51cto.com/5449828/1769120
Time function in MySQL---operation and maintenance commonly used