note 46831 added to function.checkdate
| From: | php-general at lists dot php dot net | Date: | Mon, 25 Oct 2004 06:29:04 +0000 |
| Subject: | note 46831 added to function.checkdate | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-79062@lists.php.net to get a copy of this message | ||
Just a note on the leap year thing, as leap years are as follows:
1. if the year is dividable by 4 then it is a leapyear, unless..
2. if the year is dividable by 100, then it is not a leapyear, unless..
3. if the year is dividable by 400 then it is a leapyear (instead of the millenia).
So the formula is:
$leap_year = $year % 400 == 0 || ($year % 4 == 0 && $year % 100 != 0)
----
Manual Page -- http://www.php.net/manual/en/function.checkdate.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46831
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46831&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+46831&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+46831&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+46831&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+46831&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+46831&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46831&report=yes
Search -- http://master.php.net/manage/user-notes.php