php 關於時間函數運用

php 關於日期的一些函數和用法
$today=date("Y-m-d",  strtotime("+1 day",strtotime($today)));//對日期的加減法
$today=date("Y-m-d",  strtotime("+1 mouth",strtotime($today)));//對日期的加減法
$day= cal_days_in_month(CAL_GREGORIAN, $mouth, $year);//獲得指定年月的天數
$startday=date("Y-m-d",mktime(0, 0 , 0,$mouth,1,$year));//獲得指定年月第一天日期
$startday=date("Y-m-d",mktime(0, 0 , 0,$mouth,2,$year));//獲得指定天數第二天日期
11:03 2013-8-26

配置項目的一些代碼
date_default_timezone_set('Asia/Chongqing');//設置時區

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章