I’m Trying to get the current date plus 7 days to display.
Example: Today is August 16, 2012, so this php snippet would output August 23, 2012.
$date = strtotime($date);
$date = strtotime("+7 day", $date);
echo date('M d, Y', $date);
Right now, I’m getting: Jan 08, 1970. What am I missing?
strtotimewill automatically use the current unix timestamp to base your string annotation off of.Just do:
Added Info For Future Visitors: If you need to pass a timestamp to the function, the below will work.
This will calculate
7 daysfrom yesterday: