StatGardenREF. DESK
Calculators/Date & time/Date X Months Ago Calculator
Date & time

Date X Months Ago Calculator

The calendar date a chosen number of months before or after a given date, handling month-end edge cases correctly.

Published 25 August 2026

What this calculator does

Working out what the date was six months ago, or what it will be six months from now, is not the same as counting 182 days. Calendar months vary in length from 28 to 31 days, so shifting by whole months means landing on the same day of the month, six months earlier or later, not shifting by a fixed number of days.

This calculator handles that properly, including the awkward edge cases: if the starting day does not exist in the target month, such as 31 March minus one month, it lands on the last valid day of that month instead of rolling over into the next one.

The formula

FormulaResulting date = start date, shifted by N calendar months (not N × 30 days)

The calculator takes the starting date, shifts its month by the chosen number of calendar months in the chosen direction, and keeps the same day of the month wherever that day exists in the target month. Where it does not exist, such as the 31st in a 30-day or 28-day month, it clamps to the last valid day of that month rather than overflowing into the month after.

TermMeaning
Calendar monthA shift measured in whole months on the calendar, as opposed to a fixed count of days.
Month-end clampingLanding on the last valid day of the target month when the original day does not exist there, for example 31 January minus one month giving 28 or 29 February.

The inputs explained

FieldWhat to enter
Start dateThe date to count from. Defaults to today.
Number of monthsHow many calendar months to shift by.
DirectionWhether to go backward (ago) or forward (from now) from the start date.

When to use it

Answering "what was the date 6 months ago"

A direct calendar-month shift back from today, useful for anything measured in six-month periods, from medical check-ups to financial reporting.

Working out a renewal or review date

Contracts, subscriptions and reviews are often specified in months rather than days, so shifting a start date by a fixed number of calendar months gives the correct due date.

Checking a month-end deadline

When a start date falls near the end of a month, a straight month shift can behave unexpectedly without clamping; this calculator shows exactly where it lands.

Worked examples

Every figure in the tables below is produced by this page’s own calculator at build time, so the numbers and the tool always agree. Select any row to load that scenario.

What date do you land on for different numbers of months ago, from today?

A run of common lookback periods, all counted backward from today.

Counting back from today
Months agoResulting dateDay of the week
1 month(s)10 Sep 2026Thursday
2 month(s)10 Aug 2026Monday
3 month(s)10 Jul 2026Friday
6 month(s)10 Apr 2026Friday
9 month(s)10 Jan 2026Saturday
12 month(s)10 Oct 2025Friday
Twelve months ago from today lands on the same day and month one calendar year earlier, since twelve whole months is exactly one year.

How the month-end clamp behaves shifting one month back from various end-of-month dates

A fixed one-month shift back, starting from a range of month-end dates across the year.

One month back, from late-month starting dates
Starting dateResulting date
2026-03-3128 Feb 2026
2026-05-3130 Apr 2026
2026-08-3131 Jul 2026
2026-10-3130 Sep 2026
2026-12-3130 Nov 2026
31 March one month back lands on 28 February, the last valid day of that month, rather than overflowing into March; the other 31-day starting dates clamp the same way against their preceding 30-day months.

Questions

Why is "6 months ago" not just 182 days ago?

Months are not a fixed length: they range from 28 to 31 days, so six consecutive months can total anywhere from 181 to 184 days depending on which months are included. Counting by calendar months lands on the correct same-day-of-month date; counting a fixed 182 days can land a day or two off.

What happens if the day does not exist in the target month?

The date clamps to the last valid day of that month. For example, 31 January minus one month gives 28 February in a common year, or 29 February in a leap year, rather than rolling forward into March.

Does this account for leap years?

Yes. Because the calculation clamps against the actual number of days in the target month, a shift landing on February automatically uses 28 or 29 days depending on whether that particular year is a leap year.

Can I use this for a future date instead of one in the past?

Yes, switch the direction to "from now" to shift forward by the chosen number of months instead of backward.

For date differences measured in days rather than calendar months, see the days from today calculator.