<?php
// 今天
$today = date('Ymd');
// 本月第一天
$this_first_day = date('Ym01');
// 上個月第一天
$last_first_day = date('Ym01',strtotime(date('Ym01', strtotime($today)).' -1 month'));
$date = date('Ymd'); #今天日期
$sdate = strtotime($date); #今天00:00時間綴
$edate = strtotime("$date+1day"); #明天00:00時間綴
本文轉自 Lee_吉 51CTO部落格,原文連結:http://blog.51cto.com/12173069/1982164