Last Day of Month Calculator

Enter a year and month to get the month's last date and weekday.

Result

2024-02-29
29
Thursday

How it is calculated

You enter a year (1 to 9999) and a month number (1 to 12), both whole numbers. The tool builds the first day of that month and moves to the last day of the same month using the Gregorian calendar. The length of each month comes from the fixed table of 31, 30 or 28 days, with February getting 29 when year mod 4 = 0 unless year mod 100 = 0 and year mod 400 ≠ 0. It returns the date as year-month-day, the number of days in the month, and the weekday of that last day in the page language. A month outside 1 to 12, a decimal such as 2.5 or a year of 0 gives no result. Years before the calendar's adoption are counted by the same Gregorian rule, which is a simple extension of it.

Worked example

Year 2024, month 2 (February). 2024 divides by 4 and not by 100, so it is a leap year and February has 29 days. The last day is therefore 29 February 2024. That date falls on a Thursday. Result: 2024-02-29, a month of 29 days, ending on a Thursday. For comparison, February 1900 divides by 100 but not by 400, so it ends on 1900-02-28 after 28 days.

Try this example →

Common mistakes

  • Typing the month name or a number above 12. The month field takes 1 to 12, so 13 or 0 returns nothing.
  • Assuming every year divisible by 100 is a leap year. 1900 and 2100 are not, while 2000 and 2400 are, because they also divide by 400.
  • Treating the result as the last working day. The tool gives the last calendar day, which may be a Saturday or Sunday, so check the weekday before using it as a deadline.
  • Entering a two-digit year such as 24. The tool reads it as the year 24, not 2024, and gives the weekday for that ancient year.
  • Entering the date format of another locale and swapping year and month. The date result is always year-month-day, as in 2024-02-29.

About this calculator

This calculator returns the final calendar date of any month you enter — the 28th, 29th, 30th or 31st — along with the day of the week it falls on. Most months have a fixed length, but February's length depends on the Gregorian leap year rule: a year is a leap year if it is divisible by 4, except years divisible by 100 unless they are also divisible by 400 (so 2000 was a leap year, but 1900 was not).

Knowing the exact last day of a month, and which weekday it lands on, matters for billing cycles that run to end-of-month, payroll runs, rent due dates, accounting close dates, subscription renewals, and any deadline defined as “the last business day of the month,” where you also need to check whether that date falls on a weekend.

Enter a year and month and the calculator instantly works out the last date, the total number of days in that month, and the corresponding weekday, so you do not have to count on your fingers or check a paper calendar.

Was this helpful?

You can pick up to 3 reactions.

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators