Zeller's formula weeks (reprint)

Zeller's formula:

Zeller's congruence Zeller (Zeller) formula: is the formula to calculate a week.
Just give a date, you can use this formula calculate the week.
Zeller following formula:
W is = [C /. 4] - 2C + Y + [Y /. 4] + [13 is * (M +. 1) /. 5] + D -. 1
or: w = y + [y /[c / 4] -2c + [
symbol meaning following formula:
W: weeks; obtained modulo W of 7: 0 Sunday, Monday, 1-, 2- Tuesday, Wednesday, 3-, 4-, Thursday, Friday, 5-, 6- Sat
c: century 1 (two digits)
Y: Year (last two digits)
m: month (m greater than or equal to 3, 14 or less, that Zeller's formula, a 1-year, on February 13 to be seen as a year, 14 months to calculate, for example, 2003 January 1, 2002 to be considered as the 13 May 1 is calculated)
d: date [] represents rounding, i.e., as long as the integer part.
Below 100 anniversary after establishment of People's Republic of China (October 1, 2049) to calculate the week, as follows:
W = Y + [Y /. 4] + [C /. 4] + -2c [26 is (m +. 1 ) / 10] +. 1-D
 = + 49 [49/4] + [20/4] 20 is + -2 × [× 26 is (. 1 + 10) / 10] + 1-1 of
 = 49 + [12.25] +5 -40+ [28.6]
 = 5-40 + 49 + 12 + 28
 = 54 (75 divided by I)
i.e., 1 October 2049 (100 anniversary) is Friday.
Another example is calculated March 7, 2013, as follows:
= Y + W [Y /. 4] + [C /. 4] + -2c [26 is (. 1 + m) / 10] +. 1-D
 = + 13 is [13/4] + [20/4] + 20 is -2 * [ 26 * (1 + 3) / 10] + 7-1
 = -3 (is divided by 74, attention to negative modulo operation!)
----------------- ----  
Disclaimer: this article is CSDN bloggers "to know ~ ~" original article, follow the CC 4.0 by-sa copyright agreement, reproduced, please attach the original source link and this statement.
Original link: https: //blog.csdn.net/S_999999/article/details/88723201

Guess you like

Origin www.cnblogs.com/FrankChen831X/p/11354359.html