转自:http://www.oschina.net/code/snippet_4873_3145
<?php
//output: 2010-1-2
//int mktime ([ int $hour [, int $minute [, int $second [, int $month [, int $day [, int $year]]]]]] )
echo $test = date( 'Y-m-d', mktime(0,0,0,12+1,1+1,2009))."<br>";
//明天
echo $tomorrow = date( 'Y-m-d', mktime(0,0,0,date('m') ,date('d')+1,date('Y')))."<br>";
//昨天
echo $yesterday = date( 'Y-m-d',mktime(0,0,0,date('m') ,date('d')-1,date('Y')))."<br>";
//上一个月
echo $lastmonth = date( 'Y-m-d', mktime(0,0,0,date('m')-1,date('d'), date('Y')))."<br>";
//下一年
echo $nextyear = date( 'Y-m-d', mktime(0,0,0,date('m'), date('d'), date('Y')+1))."<br>";
//明天
echo $tomorrow = date('Y-m-d',strtotime ('+1 day'))."<br>"; //明天
/*echo strtotime("now"), "\n";
echo strtotime("10 September 2000"), "\n";
echo strtotime("+1 day"), "\n";
echo strtotime("+1 week"), "\n";
echo strtotime("+1 week 2 days 4 hours 2 seconds"), "\n";
echo strtotime("next Thursday"), "\n";
echo strtotime("last Monday"), "\n"; */
//使用strtotime增加日期
echo $date1 = strtotime('2010-08-09')."<br>";
echo date('Y-m-d',strtotime("+5 day",$date1));
//相应地,要增加月,年,将day改成month或year即可
?>