Calculate the weekly formula according to the month

xiaoxiao2021-03-05  23

The calculation week can use Celler formula (only suitable for situations after October 15, 1582):

W = Y [Y / 4] [C / 4] -2C [26 (M 1) / 10] D-1

The symbols in the formula are as follows: C: Century (Year of the year); Y: Year (the low two digits of the year); M: month (M is larger than equal to 3, less than or equal to 14, ie in the Caile formula For a year, in February, it should be considered as a year 13, 14 months, such as January 1, 2005, to be calculated on 13 May 1st; D: Japan; [] Representative Taken, that is, as long as the integer part. W: Week; W to 7 samples: 0-Sunday, 1-Monday, 2-Tuesday, 3-Wednesday, 4-Thursday, 5-Friday, 6-Saturday

Take February 14, 2005 as an example: c = 20, y = 4, m = 14, D = 14 W = 4 [4/4] [20/4] - 2 * 20 [26 * (14 1) / 10] 14 - 1 = 4 1 5 - 40 39 14 - 1 = 22 (divided by more than 7 1), September 14, 2005 is Monday.

转载请注明原文地址:https://www.9cbs.com/read-36430.html

New Post(0)