2007-01-25から1日間の記事一覧

日付の判定

php

$dateに格納されている日付('Y-m-d'形式)が、今から2週間前までのものかを判定する。 $y = substr( $date,0,4 ); $m = substr( $date,5,2 ); $d = substr( $date,8,2 ); $regDate = mktime(0,0,0,$m,$d,$y); $criDate = date('Y-m-d', strtotime('-2 week',…

年末、月末の取得

php

月末取得 //入力:$month ・・・ 月(1〜12) $nextMonth = sprintf('%02d', ($month+1)); $nextMonth = (intval($nextMonth)>12)?'01':$nextMonth; $t = strtotime($regEY . '/' . $nextMonth . '/01 -1 day');// 当月末のタイムスタンプ取得 echo date('Ymd',…

備忘録