MySQL DateTime functions


How can we use interval?

delete from access_log where requestTime <= NOW() - interval 2 day

How to figure out the timezone offset of the server?

select unix_timestamp(utc_timestamp()) - unix_timestamp(now());

How can we determine the current date?

Use the CURDATE() function

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License