How to Calculate Months

Months in the Gregorian calendar vary from 30 to 31 days, with February being the only month that can have either 28 or 29 days, depending upon whether a given year is a leap year. This one-day difference can be quite important, as a missed 29th day on a leap year can set the entire calendar off by one full day each month throughout the remainder of the year. It is especially important when writing computer programs that process scheduling and billing information.

Things You'll Need

  • Calculator
Show More

Instructions

    • 1

      Memorize the following rhyme to assist you in easily knowing the general days of each of the months in a year: 30 days hath September, April, June and November. All the rest have 31, except February which has 28 -- but in leap year has 29.

    • 2

      Calculate whether a year is a leap year so you are able to add one day to February in that year. Calculating leap years requires the following rule: a leap year must be divisible evenly by 4 but not 100. If a year is evenly divisible by both 4 and 100, it must also be divisible by 400 to be a leap year. On century years (1800, 1900, 2000, etc.) the rule of division by 400 should definitely be used to check if they are leap years.

    • 3

      Add one day to February in leap years, making February 29 days long. An example of a leap year is 1988. It is divisible by 4 but not by 100. Since it isn't divisible by 100 evenly, there is no need to check to see if it is divisible by 400. An example of a year that is divisible by 4 and 100 both, yet isn't a leap year, is 1900. It is divisible by both 4 and 100, but not divisible by 400 so that means it isn't a leap year.

Learnify Hub © www.0685.com All Rights Reserved