//1、获取当前年月日
echo date('Y-m-d');
//2、获取当前时分秒
echo date('H:i:s');
//3、获取当前年月日时分秒
echo date('Y-m-d H:i:s');
//4、判断今年是否闰年
echo date('L');
//5、获取当前所属月的天数
echo date('t');
//6、获取指定月份的天数
$month = "2015-07";
echo date('t', strtotime($month . '-01'));
//7、获取指定月份的第一天
$date = "2015-07-09";
echo date('Y-m-01',strtotime($date));
//8、获取指定月份的最后一天
$date = "2015-07-09";
echo date('Y-m-d',strtotime(date('Y-m-01',strtotime($date)) . '+1 month -1 day'));
//9、获取上个月第一天
echo date('Y-m-01', strtotime('-1 month'));
//10、获取上个月的最后一天
echo date('Y-m-t', strtotime('-1 month'));
//11、获取昨天
echo date("Y-m-d",strtotime("-1 day"));
//12、获取前天,即三天前
echo date("Y-m-d",strtotime("-2 day"));
//13、获取明天
echo date("Y-m-d",strtotime("+1 day"));
//14、获取一周以后
echo date("Y-m-d",strtotime("+1 week"));
//15、获取两周零三天五小时1秒后的日期时间
echo date("Y-m-d H:i:s",strtotime("+2 week 3 days 5 hours 1 seconds"));
//16、获取下个星期四
echo date("Y-m-d",strtotime("next Thursday"));
//17、获取上周一
echo date("Y-m-d",strtotime("last Monday"));
//18、获取一个月以前
echo date("Y-m-d",strtotime("last month"));
//19、获取一个月以后
echo date("Y-m-d",strtotime("+1 month"));
//20、获取五年后
echo date("Y-m-d",strtotime("+5 year"));
//21、服务器的时间区域设置
echo date('T');