User talk:Ledrug: Difference between revisions

(→‎Last Fridays: explain leapyear calculation.)
Line 46:
::::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)
:::: Jan 0th is the day before Jan 1st, it doesn't quite matter what that means, as long as, say, Jan 0th + 10 days = Jan 10th. The "+6" to the number of days is so that the number modulo 7 gives the day of week, it just so happens that it's 6. --[[User:Ledrug|Ledrug]] 05:05, 10 November 2011 (UTC)
Anonymous user