Doing Date Math
MySQL has an array of functions for interacting with date
and datetime
values. If you'd like to do math with a date to compute a date in the future or the past, you can use the DATE_ADD()
and DATE_SUB()
functions.
There are equivalent ADDDATE()
and SUBDATE()
functions if you prefer.
Check out the docs for more details.
Last updated