Okay kiddo, have you ever wondered how we know which day of the week it is? Let me explain it to you like you're five.
Every week has seven days – Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, and Saturday. And we use a special system called a calendar to keep track of which day it is. A calendar is like a big chart that tells us what day it is, what month it is, and what year it is.
Now, to figure out the day of the week we use something called 'Zeller's Algorithm'. It's a funny name, but basically what it does is it takes the year, the month, and the day we want to find out the weekday for and asks some very simple questions.
For example, let's say we want to know what weekday it was on July 2nd, 2021. First, we input the year 2021, then the month July (which is the 7th month of the year), and finally, we input the day which is the 2nd of the month.
Now the algorithm asks us three simple questions:
- What is the century we're in? (in this case, it's the 21st century)
- What is the year within the century? (in this case, it's the 21st year of the century)
- What is the month code? (we will need to use a specific chart for this, but let's say that July has a code of 4)
Once we have those answers, we can put them into the formula, do some quick addition and division, and out pops the answer - July 2nd, 2021 was a Friday!
So, our advanced calendar and Zeller's algorithm help us figure out what day of the week it is quickly and easily. And this way, we can plan our activities and know when there's a weekend coming up!