Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Leap years
Message
From
09/07/1998 02:05:49
 
 
To
08/07/1998 01:41:46
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00115008
Message ID:
00115590
Views:
14
Sorry on giving you wrong formula:
Here is a correct one! ~>-<~
IF MM < 3  && Jan or Feb
   MM = MM + 12
   YYYY = YYYY - 1
ENDIF

 N = YYYY + 2 * 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...
The alg. is mostly readable!
Year part and Day part are easy understand.

It takes the turn of Jan and Feb to previous year month 13, and month 14...
So, the pattern will become:
 3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14

31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 31, -
Need add weekday: 3 days per month + additional!

 3,  7, ...
Thus, ppl find the formula to catch this additional days:
2 * M + Int(3 * (M + 1) / 5)

This is quite meaningful on study... ^_^;
but useless to programmer nowadays.. ~_~;

>

>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
Reply
Map
View

Click here to load this message in the networking platform