Execute query using daily timestamp (mysql event) I was trying to find a way for give users a daily "point" per online day.

So my plan was setup a MySQL event to run this query:

UPDATE users SET points=points+1 WHERE timestamp &gt; "X"


(Where X is the timestamp running since the 12.01AM of the current day).
The problem is that I didn't find any way to change daily timestamp (or the X in query) automatically. There is anyway to do it?
Thank you.
Have a look at date_format function. You can use it this way:

mysql&gt; select date_format(now(), "%Y-%m-%d 00:00:00");
+-----------------------------------------+
| date_format(now(), "%Y-%m-%d 00:00:00") |
+-----------------------------------------+
| 2016-04-25 00:00:00                     |
+-----------------------------------------+


Or, if you want minute 1, as per your example:

mysql&gt; select date_format(now(), "%Y-%m-%d 00:01:00");
+-----------------------------------------+
| date_format(now(), "%Y-%m-%d 00:01:00") |
+-----------------------------------------+
| 2016-04-25 00:01:00                     |
+-----------------------------------------+