Archive for the ‘date’ Tag
MySQL add 3 years to a date
It may happens if you are silly like me, that you just inserted a lot of records and then realized that you have inserted a mistaken date. In my case the date was a 3 years earlier than the required.
In order to fix it rapidly with mysql you can use the date_add function. Following a quick ad self explaining statement
update <table> set <field>=date_add(<field>,interval 3 year) where id>3289;
Leave a Comment
Comments (1)