2008-11-20

Add datetime in MySQL

Example: plus datetime 31 days;
  • update table_name set datetime_field = ADDDATE(datetime_field, 31);
Example: minus datetime 31 days;
  • update table_name set datetime_field = ADDDATE(datetime_field, -31);

No comments: