I have a date returned as part of a mySQL query in the form 2010-09-17
I would like to set the variables $Date2 to $Date5 as follows:
$Dat
You can also use the following format
strtotime("-3 days", time());
strtotime("+1 day", strtotime($date));
You can stack changes this way:
strtotime("+1 day", strtotime("+1 year", strtotime($date)));
Note the difference between this approach and the one in other answers: instead of concatenating the values +1 day
and
, you can just pass in the timestamp as the second parameter of strtotime
.