a day is 86400 seconds.
$tomorrow = date('y:m:d', time() + 86400);
nickf
2008-11-10 07:03:30
The date_add()
function should do what you want. In addition, check out the docs (unofficial, but the official ones are a bit sparse) for the DateTime
object, it's much nicer to work with than the procedural functions in PHP.
php supports c style date functions. You can add or substract date-periods with english-language style phrases via the strtotime function. examples...
$Today=date('y:m:d');
// add 3 days to date
$NewDate=Date('y:m:d', strtotime("+3 days"));
// subtract 3 days from date
$NewDate=Date('y:m:d', strtotime("-3 days"));
// PHP returns last sunday's date
$NewDate=Date('y:m:d', strtotime("Last Sunday"));
// One week from last sunday
$NewDate=Date('y:m:d', strtotime("+7 days Last Sunday"));