Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Leap years
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00115008
Message ID:
00115160
Views:
14
>Hello All,
>A simple question but one I have gone completelty blank on.
>
>How do I define a leap year?? I know that year % 4 returning a 0 is not enough. What's the rest??
>
>Thanks



Hi all, after watching each formula to handle leap year, I feel today progr is very lucky.

At 198X, If progr need to build a calendar, it is a huge job to do~~~
Now, just call the Internal Window, ocx to do... ^0^'

Now, in vfp, we have CDOW(), DOW() to return the weekday value.
When I start learn GWBASIC, I only get a mathematical formula to do....
IF MM < 3  && Jan or Feb
  MM = MM + 12
  YYYY = YYYY + 1
ENDIF

N = YYYY + MM + DD + 1 + Int(YYYY/4) - Int(YYYY/100) + Int(YYYY/400) + ;
    + Int((3 * MM + 1)/5)
nWeekDay = MOD(N, 7)

* if nWeekDay is Zero, Mean SunDay and so on...
Using this formula, I have made a Calendar for following Language:
GWBASIC, PASCAL, C, C++

but now, wow...... no need to do much silly thing but use simple function!!



Wanting to Be a Mathematician...
I can tell you an interest thing on Leap Year!!

at 1752, Sept! There is two times from 3 to 13 !!
Why? Because ppl wonder the different from leap 1/4 year problem is not accuately enough and thus you got the new formula... ~_^

You can simple type: CAL 1752 in UNIX and see what I said here!!

p.s. maybe it is too informatic, but know it just for fun!!
MayBe I interest that the dead date of christ is Friday or NOT! :P
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform