PHP中时间运算

来源:互联网 发布:淘宝天猫优惠券怎么做 编辑:程序博客网 时间:2024/05/17 01:00
<script type="text/javascript"><!--google_ad_client = "pub-4490194096475053";/* 内容页,300x250,第一屏 */google_ad_slot = "3685991503";google_ad_width = 300;google_ad_height = 250;//--></script><script type="text/javascript"src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
$tomorrow = date("Y-m-d", mktime(0,0,0,4,1+1,2005));

$tomorrow = date("Y-m-d", mktime(0,0,0,date("m") ,date("d")+1,date("Y"))); //明天

$yesterday = date("Y-m-d", mktime(0,0,0,date("m") ,date("d")-1,date("Y"))); //昨天

$lastmonth = date("Y-m-d", mktime(0,0,0,date("m")-1,date("d"), date("Y"))); //上一个月

$nextyear = date("Y-m-d", mktime(0,0,0,date("m"), date("d", date("Y")+1)); //下一年

$today = date("Ymd",strtotime ("+1 day"));

$date1="2006-08-09″;
echo date(’Y-m-d’,strtotime("$date1 +5 day")); //相应的,要增加月,年,将day改成month或year即可
?>
原创粉丝点击