Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
After January 1st
Message
De
04/01/2000 04:10:55
 
 
À
04/01/2000 04:07:26
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00308678
Message ID:
00312212
Vues:
49
>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,

Your statement is correct, but someone else posted it as a CASE statement. That was much clearer, at least to me.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform