New answers tagged

0

Another variation would be to do the date math as follows SINCE MIDNIGHT (12:00 AM) UPDATE users SET points=points+1 WHERE timestamp > (CURDATE() + INTERVAL 0 SECOND); SINCE 12:01 AM UPDATE users SET points=points+1 WHERE timestamp > (CURDATE() + INTERVAL 1 MINUTE); Since you asked about a MySQL Event, you can do the same thing Something like ...


1

Have a look at date_format function. You can use it this way: mysql> 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 ...


0

You write "I don't need the time zone information", however datatype TIMESTAMP WITH LOCAL TIME ZONE has time zone information stored. For a TIMESTAMP WITH LOCAL TIME ZONE column I don't see any difference between CURRENT_TIMESTAMP and LOCALTIMESTAMP either of them should work in the same way. CURRENT_TIMESTAMP returns current data and time as of datatype ...



Top 50 recent answers are included