2024 Author: Malcolm Clapton | [email protected]. Last modified: 2023-12-17 03:44
It is not necessary to be a genius or clairvoyant to determine the day of the week for any date without the help of a calendar. It is enough to memorize a couple of formulas. At the same time, this exercise can be a good workout for the mind and memory.
To determine the day of the week by date, you need to use the formula:
day of week = (day + month code + year code)% 7
Explanations
Month code
Month and year codes are perhaps the hardest part of the formula.
You just need to remember the month code.
- 1 - January, October;
- 2 - May;
- 3 - August;
- 4 - February, March, November;
- 5 - June;
- 6 - December, September;
- 0 - April, July.
The easiest way to remember such illogical data is to use associations.
Year code
The year code in the XXI century is calculated using the formula:
year code = (6 + last two digits of the year + last two digits of the year / 4)% 7
The "/" operator means incomplete quotient, that is, the whole part of the result of division.
- 2015: (6 + 15 + 15/4)% 7 = (6 + 15 + 3)% 7 = 24% 7 = 4;
- 2016: (6 + 16 + 16/4)% 7 = (6 + 16 + 4)% 7 = 26% 7 = 5;
- 2017: (6 + 17 + 17/4)% 7 = (6 + 17 + 4)% 7 = 27% 7 = 6;
- 2026: (6 + 26 + 26/4)% 7 = (6 + 26 + 6)% 7 = 38% 7 = 3.
If you want to know the day of the week for the date of another century, you will also have to take into account the values of the century (6, 4, 2, 0). Instead of 6 for the next centuries, the following values will be:
- 16xx: 6;
- 17xx: 4;
- 18xx: 2;
- 19xx: 0;
- 20xx: 6;
- 21xx: 4 and so on.
% 7
It's simple here:% is the remainder operator for division.
Decoding the result
Countdown start - weekend, that is: 0 - Saturday, 1 - Sunday, and so on.
Calculation examples
- July 25, 2016: (25 + 0 + 5)% 7 = 30% 7 = 2 - Monday;
- August 8, 2017: (8 + 3 + 6)% 7 = 17% 7 = 3 - Tuesday;
-
January 5, 2127:
- (4 + 27 + 27/4)% 7 = (4 + 27 + 3)% 7 = 34% 7 = 6 - year code;
- (5 + 1 + 6)% 7 = 10% 7 = 5 - Thursday.
Of course, calculating the day of the week by date in your head is not a vital skill in the technology age. But this is a non-trivial exercise for everyone who loves to develop their memory and perform operations with numbers.
UPD. Unfortunately, this formula does not work well for leap years. Until February 29 inclusive, you will have to add one more unit to the formula to get the correct day. Thanks to the readers for finding a bug.
Recommended:
4 ideas for those looking to dry out without losing muscle
By intensely eating and swinging, we gain muscle mass and fat. And now it is time to bring the body into a more aesthetic form, that is, to remove the unnecessary, while preserving the necessary as much as possible. How to dry out and minimize muscle loss?
How I lived for a week without likes on VKontakte
Whatever VKontakte says, likes are an indicator of the quality of an SMM specialist's work. We figure out what their disabling will affect
REVIEW: “At the limit. A week without self-pity ", Eric Bertrand Larssen
The book “On the Limit. A week without self-pity”has become a bestseller for a reason. This is not just a story about how to think and live. This is a guide to action
Sunrise Calendar - the calendar you must love
If you're used to scheduling your to-dos with an electronic calendar, just be sure to give Sunrise a try. The app for Android and iOS has an excellent design and decent functionality. Sunrise marks the birth of a new day, next worries, tasks and meetings.
Calendar Menu for OS X gives quick access to calendar and reminders
Clicking on the clock in the Windows tray to display the calendar is an undeniably convenient feature of the Microsoft system. How many times have OS X been praised for its thoughtfulness, but never got the little thing that Apple's system is so famous for.