inline Add time to MySQL dates

The easiest way to move a collection of dates by a given amount of time is to use the DATE_ADD-function:

UPDATE [table] SET [column] = DATE_ADD([column], INTERVAL [amount] {DAY|MONTH|MINUTE|...})

This works with DATE and DATETIME columns. A full list of possible interval-units can be found here.

Comments

comments powered by Disqus