User talk:Ledrug: Difference between revisions

→‎Last Fridays: explain leapyear calculation.
(→‎Last Fridays: More questions)
(→‎Last Fridays: explain leapyear calculation.)
Line 45:
::: That's the number of days between Jan 0th of year y and some unspecified past date. All we need is that that number modulo 7 gives day of week of Jan 0th, y AD. --[[User:Ledrug|Ledrug]] 02:09, 10 November 2011 (UTC)
::::Is "Jan 0th" just Dec 31 of the previous year? Where did the formula come from? --[[User:Mwn3d|Mwn3d]] 02:21, 10 November 2011 (UTC)
:::::it is a formula that takes leap years into account: a year has 365 days, except every 4 years (y-1)/4, when it has 366, so those need to be added. but, every 100 years is not a leap year (y-1)/100, so those need to be subtracted again, and then every 400 years is a leap year again so (y-1)/400 needs to be added back. it is pretty straightforward once analyzed. i don't know what the +6 at the end is for though.--[[User:EMBee|eMBee]] 03:22, 10 November 2011 (UTC)
Anonymous user