Jump to content

How do you add 7 days to now()?


twilightnights

Recommended Posts

If you're dealing with datetimes, you can use these:

 

http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-add

 

Ok I tried that but I can't get this to work..

 

$query7 = "UPDATE `tool` SET DueDate='DATE_ADD(now(),INTERVAL 7 DAYS)' WHERE ToolID='$Tool1'";

 

am I butchering the syntax?

mysql> SELECT NOW(),NOW() + INTERVAL 7 DAY;
+---------------------+------------------------+
| NOW()               | NOW() + INTERVAL 7 DAY |
+---------------------+------------------------+
| 2007-06-14 15:37:39 | 2007-06-21 15:37:39    |
+---------------------+------------------------+
1 row in set (0.00 sec)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.