note 98251 deleted from function.date by derick

From: Date: Sun, 15 Aug 2010 18:36:12 +0000
Subject: note 98251 deleted from function.date by derick
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-171700@lists.php.net to get a copy of this message
Note Submitter: gaetan at exultet dot net ---- I needed ton obtain date of the first day and the last day of a month. It's OK even for leap years. Date de début et de fin du mois, même pour années bisextiles <?Php $year=2008; $month=2; // $begin=mktime(0,0,0,$month,1,$year); $end=strtotime("+1month -1day",$begin); echo date('Y-m-d',$begin); // 2008-02-01 echo ' - '; echo date('Y-m-d',$end); // 2008-02-29 ?> Hope it helps someone

« previous php.notes (#171700) next »