Tricks to Solve Calendar Problems (original) (raw)

Last Updated : 23 Jul, 2025

The topic of **calendars is essential for various competitive exams and placement tests. While it might initially seem challenging, the tricks and methods shared here will simplify the concepts, making calendars easy to understand and apply.

A **calendar is a system for organizing and dividing time into days, weeks, months, and years. **Calendars are based on astronomical events, such as the rotation of the Earth (**day), the lunar cycle (**month), and the Earth's orbit around the sun (**year), and have been essential for managing time and planning in societies throughout history.

Basic Concepts and Terminology

**Leap Year:

**Ordinary Year

**Odd Days

**Day Codes

Days of the week can be assigned numerical codes to simplify calculations:

Sunday Monday Tuesday Wednesday Thursday Friday Saturday
0 1 2 3 4 5 6

Month Codes

Each month is given a code to simplify day calculations, particularly for non-leap and leap years:

Month Code
January For leap year: 6, For non-leap year: 0
February For leap: 2, For non-leap year: 3
March 3
April 6
May 1
June 4
July 6
August 2
September 5
October 0
November 3
December 5

Century Codes

The century codes are used to simplify day-of-week calculations for dates across centuries.

Century Code
1600-1699 6
1700-1799 4
1800-1899 2
1900-1999 0
2000>= 6

**Types of Questions

**Type 1: Given a month, date, and year, use this data to find the day of the week.

**Type 2: Given a day, with its date, find which day will be after x months, **x days, or **x years.

**Tricks and Shortcuts for Calendar Questions

Let us Understand them with the help of small and easy tricks.

The Date-to-Day Code Trick

Suppose we have given a date like 25 May 2003. and we have to calculate the day for this.

**Trick
**Step: 1 = last 2 digits of a year
**Step: 2 = month code
**Step: 3 = Date
**Step: 4 = last 2 digits of year divided by 4(quotient)
**Step: 5 = Year code
**Now add all these and find its remainder with 7.
**Now, whatever the value you are getting convert it into Week Day Code and We will get the required Day.

**Solving the above example:

**Adding them ( values obtained after all the 5 steps )

**We get (3 +1 + 25 + 0 + 6) = 35.

So, **35/7 = 0(Remainder).

**And we have already mentioned in Trick’s section that 0 is the Code for Sunday. So, the Weekday on 25 May 2003 was Sunday.

Day Difference Trick

**It was Monday 15th October 1923. What was the day on 17 November 1923?

**TRICK - We simply have to add the day's between two given dates, and add it to the code of the day given
**in question and divide it by 7 to get the remainder .

**Solving the above question:

Since October has 31 days, there are 16 days from October 15 to October 31, and 17 days from November 1 to November 17.

Adding these gives (16 + 17) = 33 days.

Dividing 33 by 7, we get a remainder of 5.

Now, add 5 to the code for Monday (1, as given in the tricks), then divide by 7 to find the remainder: (5 + 1) mod 7 = 6. This remainder of 6 corresponds to Saturday.

Hence, it was **Saturday on 17th November 1923.

Zeller Congruence

Zeller’s congruence is an algorithm devised by Christian Zeller to **calculate the day of the week.

It is given by the formula:

f = (d + \left\lfloor \frac{13(m + 1)}{5} \right\rfloor + Y + \left\lfloor \frac{Y}{4} \right\rfloor + \left\lfloor \frac{C}{4} \right\rfloor - 2C)\mod\ 7

Where

In the traditional Zeller's congruence algorithm, the resulting value, f, is mapped as follows:

**For example: 20th March 1882

**Solution:

For the given question the solution through Zeller's formula is :

f = (20 + \left\lfloor \frac{13(3 + 1)}{5} \right\rfloor + 82 + \left\lfloor \frac{82}{4} \right\rfloor + \left\lfloor \frac{18}{4} \right\rfloor - 2\times18)\mod\ 7

= (20 + 10 +82 + 20 +4 -36) mod 7

(100) mod 7

= 2 (According to the code for the week).

_Hence it was Monday on 20th march 1882.

The Ordinary Year Month Code Trick

In an ordinary year, the first days of the month are the same for:

The Leap Year Month Code Trick

In a leap year, the first days of the months are the same for:

**Also Check: