Posted by Jerry Stuckle on 08/28/06 20:54
Steve wrote:
> On Sun, 27 Aug 2006 06:36:09 -0700, Gucci wrote:
>
>
>> if ($year%100==0) {
>> if ($year%400==0) {$flag = true;}
>
>
> Are you *sure* this logic is correct? I'm not... and if it is, why bother
> with the check for 100 years?
>
Yes, that is correct.
It is a leap year if the year is divisible by 400, or if its divisible
by 4 and not by 100.
He needs the $year % 100 for the else clause.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|