1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
echo ' 上周起始时间: ' ; echo date ( "Y-m-d H:i:s" , mktime (0, 0 , 0, date ( "m" ), date ( "d" )- date ( "w" )+1-7, date ( "Y" ))), "\n" ; echo date ( "Y-m-d H:i:s" , mktime (23,59,59, date ( "m" ), date ( "d" )- date ( "w" )+7-7, date ( "Y" ))), "\n" ; echo ' 本周起始时间: ' ; echo date ( "Y-m-d H:i:s" , mktime (0, 0 , 0, date ( "m" ), date ( "d" )- date ( "w" )+1, date ( "Y" ))), "\n" ; echo date ( "Y-m-d H:i:s" , mktime (23,59,59, date ( "m" ), date ( "d" )- date ( "w" )+7, date ( "Y" ))), "\n" ; echo ' 上月起始时间: ' ; echo date ( "Y-m-d H:i:s" , mktime (0, 0 , 0, date ( "m" )-1,1, date ( "Y" ))), "\n" ; echo date ( "Y-m-d H:i:s" , mktime (23,59,59, date ( "m" ) ,0, date ( "Y" ))), "\n" ; echo ' 本月起始时间: ' ; echo date ( "Y-m-d H:i:s" , mktime (0, 0 , 0, date ( "m" ),1, date ( "Y" ))), "\n" ; echo date ( "Y-m-d H:i:s" , mktime (23,59,59, date ( "m" ), date ( "t" ), date ( "Y" ))), "\n" ; //本年起始 echo date (‘Y-01-01’); //结束日期 echo date (‘Y-12-31’); |