-
- echo date("Ymd",strtotime("now")), "\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";
-
- echo "**********月:";
- echo date( 'n');
- echo "************曜日:";
- echo date("w");
- echo "*********** *日付:" ;
- echo date("t");
- echo "*******";
-
- 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";
-
- $season = ceil((date('n'))/3);//これは第何四半期ですかmonth
- echo '
今四半期の開始時刻: ';
- echo date('Y-m-d H:i:s', mktime(0, 0, 0,$season*3-3+1, 1,date( 'Y'))),"\n";
- echo date('Y-m-d H:i:s', mktime(23,59,59,$season*3,date('t',mktime( 0, 0, 0,$season*3,1,date("Y"))),date('Y'))),"\n";
-
- $season = ceil((date('n') )/3) -1; //最後の四半期はどの四半期ですか? echo '
最後の四半期の開始時刻: ';
- echo date('Y-m-d H:i:s', mktime(0) , 0, 0 ,$season*3-3+1,1,date('Y'))),"\n";
- echo date('Y-m-d H:i:s', mktime(23,59,59) ,$season* 3,date('t',mktime(0, 0, 0,$season*3,1,date("Y"))),date('Y'))),"\n";
- ?>
-
-
-
コードをコピー
|
PHP