Recurring Date Calculator

Second Tuesday of the month, last Friday of the quarter, the 25th unless the 25th is a Saturday. Rules like these are easy to state and tedious to expand, and the tedium is where the mistakes are.

The first matching date on or after this day is occurrence one.
Weeks for the weekly rule, months for the two monthly rules, years for the yearly one. 2 gives fortnightly or every other month.
Used by the fixed-day rule. 31 lands on the last day in months that are shorter.
Recurring Date Calculator — Second Tuesdays, Last Fridays and the 31st in Short MonthsBuildFigure

Four rules, and why they are not interchangeable

Most recurring schedules are one of four shapes, and they drift apart from each other over time.

RuleAnchored toBehaviour over a year
Every Nth week on chosen weekdaysThe weekdayAlways the same weekday; the date of the month wanders
A fixed day of the monthThe dateAlways the same date; the weekday cycles through all seven
Nth or last weekday of the monthBoth, looselySame weekday, roughly the same part of the month, 28 or 35 days apart
Same date every yearThe dateTwelve months apart, weekday advancing one or two each year

The third is the one people describe in speech and get wrong on paper. "Second Tuesday" is not "the 8th to the 14th" in any simple sense, and the gap between consecutive second Tuesdays is 28 days in most months and 35 in some. Counting them by hand across a year is where errors creep in.

Month ends, and the 31st problem

A rule set to the 31st has to do something in February. The two available answers are to use the last day the month has, or to roll into the following month. This page clamps to the last day and marks the row, because that is what most payment and payroll schedules do — a payment due on the 31st is due on the 28th of February, not the 3rd of March. It is not universal, though. If a counterparty's system rolls forward instead, its dates will differ from these in four months of the year, and it is worth establishing which convention applies before the first mismatch.

The same clamping applies to the yearly rule. A recurrence anchored to February 29 produces February 28 in common years rather than March 1.

Moving dates off weekends and holidays

Once a rule produces a date, something has to happen when the date is not a working day. There are three ordinary answers and this page offers all of them plus leaving it alone:

  • Push forward to the next working day. The common default for meetings and for anything where being late is acceptable.
  • Pull back to the previous working day. Usual for payroll and for deadlines, where being early is acceptable and being late is not.
  • Drop it. Correct when the occurrence has no meaning off its intended day.

Both of the moving options walk past consecutive non-working days, so a date landing on the Saturday before a Monday holiday moves to the Tuesday. The holidays are the eleven US federal ones, computed from their rules rather than looked up in a table, including the Friday or Monday observance when a fixed-date holiday falls at a weekend. Federal holidays are not the same thing as a bank holiday, a state holiday, or your own company's closure days, and none of those are modelled here.

Where the interval counts from

For the weekly rule, the interval counts weeks from the week containing the start date, so every second week means alternating weeks on that calendar, not alternating occurrences. If two weekdays are checked and the interval is 2, you get two dates every fortnight rather than one date every fortnight. For the monthly rules the interval counts calendar months from the start date's month, so every third month from a February start gives February, May, August, November.

If you need a plain list instead of a rule

This page is for rules that are hard to expand by hand — the Nth weekday of a month, month-end clamping, and shifting off non-working days. When what you have is simply a start, an end and a step in days or weeks, and you want the output as CSV or in a particular date format, the date list generator handles that case with far more output options. For counting days or working days between two fixed dates, the date calculator is the shorter route.

Questions people ask

Why do some months produce no date at all?

Two rules can miss. A fifth Tuesday exists in only four or five months of a typical year, so months without one are skipped rather than falling back to the fourth. And under the fixed-day rule set to 29, 30 or 31, the date clamps rather than skipping — those months still appear, marked as clamped.

Does the holiday list cover my state or my company?

No. It is the eleven US federal holidays and nothing else. State holidays, bank holidays, religious observances and company shutdown days are not included. If your schedule has to dodge those too, treat the output as a first pass and check it against your own calendar.

How is a holiday that falls on a weekend handled?

The observed date is used, which is the Friday before for a Saturday holiday and the Monday after for a Sunday one. That means the observed day is the one treated as non-working, and the actual date, if different, is an ordinary working day.

Can I get more than 200 dates?

Not in one pass. Two hundred is enough for four years of monthly occurrences or roughly four years of fortnightly ones, and beyond that a generated list stops being something anyone checks. Move the start date forward and run it again for a later block.

Related