Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
After January 1st
Message
From
04/01/2000 04:07:26
Walter Meester
HoogkarspelNetherlands
 
 
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00308678
Message ID:
00312210
Views:
59
Fred,

>>The year is divisable by 4 except for the century years which are not divisable by 4.
>>
>>(20 mod 4 = 0) --> leap year
>>(19 mod 4 = 3) --> not a leap year
>>
>>Walter,
>
>You must include the 100 & 400 checks. 2100, 2200, 2300 will NOT be leap years, but 2400 will be.

I did: the exception was for century years the century was not divisable by 4 (thus years not divisable by 400), though I must say I could have been more clear.

So:

Leapyear = MOD(nYear,4)=0 AND (MOD(nYear,100) # 0 OR MOD(nYear,400)=0)

Walter,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform