newbe101
asked on
php mysql add days to date variable
trying to add a number of days variable to a date variable... here is what I have so far (not working):
$newDate = strtotme("+$days_to_add day", $existing_date());
echo "<br>Days added: $days_to_add";
echo "<br>New date: $newDate<br>";
$newDate = strtotme("+$days_to_add day", $existing_date());
echo "<br>Days added: $days_to_add";
echo "<br>New date: $newDate<br>";
ASKER
$existing_date is a date pulled from my mysql database (0000-00-00).
here is my echo results:
Days added: 60 to 2008-06-08
New date: 5186008
I don't know why new date looks like that... shouldn't it be in the 0000-00-00 format?
here is my echo results:
Days added: 60 to 2008-06-08
New date: 5186008
I don't know why new date looks like that... shouldn't it be in the 0000-00-00 format?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
perfect... thanks again!
should lokk like this:
$newDate = strtotime("+$days_to_add day", $existing_date);
echo "<br>Days added: $days_to_add";
echo "<br>New date: $newDate<br>";