3 ms·
A simpler and easier way to calculate the day of the week for any date is the First Sunday Doomsday algorithm: http://firstsundaydoomsday.blogspot.com/2009/12/q
by bumbledraven 7y ago
A simpler and easier way to calculate the day of the week for any date is the First Sunday Doomsday algorithm: http://firstsundaydoomsday.blogspot.com/2009/12/quick-start-guide.html http://firstsundaydoomsday.blogspot.com/2009/12/quick-start-...
(There’s also a earn-by-example page: http://firstsundaydoomsday.blogspot.com/2011/01/learn-by-example.html http://firstsundaydoomsday.blogspot.com/2011/01/learn-by-exa...)
Using Sundays rather than doomsdays simplifies the arithmetic. Another improvement the above approach incorporates is the odd+11 rule for calculating the year code.