" n";
echo date("Ymd",strtotime("-1 週間の月曜日")), "n";
echo date("Ymd",strtotime("-1 週間の日曜日")), "n";
echo date("Ymd",strtotime("+0 週の月曜日")), "n"; echo date("Ymd",strtotime("+0 週の日曜日")), "n"; / date('n') 月 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";
$getMonthDays = date("t",mktime(0, 0 , 0,date('n')+(date('n')-1)%3 , 1,date("Y")));//この四半期の最後の月の日数
echo '
この四半期:
'
echo date('Y-m-d H:i: s', mktime(0, 0, 0,date('n')-(date('n')-1)%3,1,date('Y'))),"n"; 'Y-m-d H :i:s', mktime(23,59,59,date('n')+(date('n')-1)%3,$getMonthDays,date('Y'))),"ん」;