Cogre Method of Finding weekday of Gregorian date without calendar (Updated)

Cogre Day Method
(Cogre - Co6 Gregorian)
Given date: D-M-Y 
1. Find the Cogre Year Number (Cy)

 For January and February, Cy = (Y-1) + Int((Y-1)/4) - Int((Y-1)/100) + Int((Y-1)/400)
For other months, Cy = (Y-1) + Int(Y/4) - Int(Y/100) + Int(Y/400) 
Int(x) = Integer Part of x

2. Cogre Month Number, Cm

Month Index
Months
Months
Months
0
1
10

1
5


2
8


3
2
3
11
4
6


5
9
12

6
4
7


Month
1
2
3
4
5
6
7
8
9
10
11
12
Cm
0
3
3
6
1
4
6
2
5
0
3
5

3. Find Cogre Day Number Cd = Cy+Cm+D

4. Find Cogre weekday, 
Q=Cd/7;
Cw = [ Q-Int(Q) ] * 7

5. Find the weekday as per given table:
Cw
Weekday
0
Sunday
1
Monday
2
Tuesday
3
Wednesday
4
Thursday
5
Friday
6
Saturday
Example: 
D-M-Y: 12.08.2015
D=12, M=8, Y=2015
Cy = (2014)+Int(2015/4)-Int(2015/100)+Int(2015/400)
Cy = 2014 + Int(503.75) - Int(20.15) + Int(5.0375) = 2014+503-20+5 =2502
Cm= 2
Cd = Cy+Cm+D = 2502+2+12 = 2516;
Q=2516/7 = 359.4285;
Cw=7*(359.4285-359)=3 = Wednesday;






Comments

Popular posts from this blog

Technical Publication Ebooks Free Download

Volvo Group is Hiring Fresh Engineering Graduates under National Apprenticeship Training Scheme(NATS) for Skilling Indian Youth