note 38954 deleted from function.cal-days-in-month by didou

From: Date: Tue, 27 Jan 2004 08:38:56 +0000
Subject: note 38954 deleted from function.cal-days-in-month by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-64236@lists.php.net to get a copy of this message
Note Submitter: saish ---- heres the function to add the 100 and 400 year correction to David Bindel's fantastic function : function days_in_month($month, $year) { // calculate number of days in a month return $month == 2 ? ($year % 4 ? 28 : ($year % 100 ? 29 : ($year % 400 ? 28 : 29))) : ($month % 7 % 2 ? 31 : 30); }

« previous php.notes (#64236) next »