Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any function for check if its a leap year ?
Message
From
25/02/2003 03:07:59
Walter Meester
HoogkarspelNetherlands
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00756383
Message ID:
00757432
Views:
14
>Even shorter and faster than the others:...
Hmmm,

You've got me....
I Didn't check for your option.

Walter,

>Faster? I think not. My appended solution is 45% to 50% faster each time. Do this test
* LeapTest
>
>LOCAL lnstart, lnstop, llisleap,;
>  ltstart, ltstop, lni, lnj
>ltstart = DATETIME()
>lnstart = 1600
>lnstop = 9000
>FOR lnj = 1 TO 1000
>  FOR lni = lnstart TO lnstop
>    llisleap = (lni % 4 = 0) AND ((NOT lni % 100 = 0) OR (lni % 400 = 0))
>  NEXT
>NEXT
>ltstop = DATETIME()
>? ltstop - ltstart
>ltstart = DATETIME()
>FOR lnj = 1 TO 1000
>  FOR lni = lnstart TO lnstop
>    llisleap = NOT EMPTY(DATE(lni, 2, 29))
>  NEXT
>NEXT
>ltstop = DATETIME()
>? ltstop - ltstart
Previous
Reply
Map
View

Click here to load this message in the networking platform