Practical guide

COUNT vs UNTIL: Ending a Recurring Calendar Event Correctly

Use COUNT for a chosen number of generated occurrences or UNTIL for an inclusive cutoff. DTSTART counts first. Excluding an occurrence does not top up COUNT, and a cutoff between scheduled starts does not create a final event.

Calendar users checking event rules and practical date choices · 5 minute read · Published

Choose a count or a cutoff

COUNT and UNTIL are alternative ending conditions and must not appear together in one recurrence value. COUNT bounds the generated number of occurrences, with DTSTART counting as the first. UNTIL bounds the schedule inclusively: an occurrence exactly at the cutoff is allowed, while a later one is not. [1]

Four planned occurrences

Use COUNT=4, then separately inspect exceptions.

No event after a particular instant or date

Use a correctly typed UNTIL and inspect the last generated start.

If neither ending condition is present, the rule is unbounded under the standard. A limited calendar display is not evidence that the series itself ends.

Match the cutoff to the start representation

For a DATE-valued DTSTART, use a DATE-valued UNTIL such as 20270119. For a UTC DATE-TIME DTSTART, use a UTC cutoff such as 20270119T140000Z. When DTSTART uses a named-zone reference, the standard requires its DATE-TIME UNTIL in UTC. This guide’s timed examples use UTC to avoid an implicit zone conversion. [1]

An UNTIL time is an instant, not an instruction to include that entire local day. A meeting at 14:00Z on January 19 is included by UNTIL=20270119T140000Z and excluded by UNTIL=20270119T135959Z. Convert any intended local cutoff using the appropriate date-specific zone rules before writing a named-zone series.

Inspect the last event and the excluded one

On a narrow screen, swipe within the table to read the remaining columns.

Original weekly UTC example: start Tuesday 5 January 2027 at 14:00Z
Ending/inputGenerated rule startsFinal set
COUNT=45, 12, 19, 26 JanuaryAll four
UNTIL=19 Jan 14:00Z5, 12, 19 JanuaryAll three
UNTIL=19 Jan 13:59:59Z5, 12 JanuaryBoth
COUNT=4; EXDATE=12 Jan 14:00Z5, 12, 19, 26 January5, 19, 26 January

The exclusion leaves three events. It does not cause February 2 to be generated as a replacement fifth rule date. EXDATE is applied after the inclusion set is assembled and takes precedence over RRULE and RDATE. [2]

Two complete ending examples

The first practice file combines a four-occurrence rule with one explicit exclusion. The second ends at the third weekly start. Both have 14:00–15:00Z event intervals; DTEND defines the event end, not the recurrence cutoff. No guests, invitations or alarms are present.

Download practice count with exclusion (.ics)

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//DayMoon Calendar//Fictional Examples 1.0//EN
BEGIN:VEVENT
UID:c94361df5677b4e59aedeb4f@daymooncalendar.com
DTSTAMP:20261108T000000Z
DTSTART:20270105T140000Z
DTEND:20270105T150000Z
SUMMARY:Practice - Count with excluded date
RRULE:FREQ=WEEKLY;COUNT=4
EXDATE:20270112T140000Z
END:VEVENT
END:VCALENDAR

Download practice until inclusive (.ics)

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//DayMoon Calendar//Fictional Examples 1.0//EN
BEGIN:VEVENT
UID:3a5aa5536a24605e71c7345f@daymooncalendar.com
DTSTAMP:20261108T000000Z
DTSTART:20270105T140000Z
DTEND:20270105T150000Z
SUMMARY:Practice - Inclusive cutoff
RRULE:FREQ=WEEKLY;UNTIL=20270119T140000Z
END:VEVENT
END:VCALENDAR

Check ending conditions in a larger file

Unfold the content lines before inspecting a long RRULE. Find DTSTART, the single RRULE, RDATE, EXDATE and any separate RECURRENCE-ID components sharing the UID. Confirm the start matches the pattern and the cutoff uses the expected type. Repeating RRULE properties is not a supported way to combine competing end policies. [2]

RDATE can explicitly add dates outside a rule’s generated sequence. Therefore an ended RRULE alone does not prove that no separately added later date exists in the overall event set. Inspect the actual RDATE list rather than treating UNTIL as a global ban on every date property.

For “four meetings that actually occur after cancellations,” decide whether to extend the rule, add a confirmed makeup date or accept a smaller final set. That is a scheduling decision; the file cannot infer the organizer’s intention.

Two complete decisions

The final planned meeting starts at 14:00Z. I use a cutoff of 13:59:59Z that day. Will it appear?

No. Its start is later than the inclusive cutoff.

Inclusive means a start equal to the cutoff is included. It does not round the cutoff to the end of its day. Use the intended 14:00Z instant or a verified later boundary, then check the generated list.

COUNT=4 has one cancelled date. Why are only three events left?

The cancelled date was removed after the four rule starts were generated.

COUNT generated January 5, 12, 19 and 26. EXDATE removed January 12, leaving three. February 2 is outside that counted rule. An organizer wanting four remaining meetings must deliberately choose and encode the additional occurrence.

Validate one before, one at and one after the boundary

For a cutoff, inspect a start immediately before it, exactly at it if scheduled, and the next candidate after it. For a count, enumerate DTSTART through the final rule occurrence and apply every exclusion and addition. Compare those dates with the app’s actual result after a safe isolated test; the arithmetic checks here do not prove every calendar preserves the file unchanged.

Sources and further reading

  1. RFC 5545 §3.3.10 — Recurrence valueFrequency, intervals, ordinal weekdays, set positions, count/cutoff and invalid generated dates.
  2. RFC 5545 §3.8.5.3 — Recurrence setDTSTART synchronization, inclusion/exclusion precedence and documented examples.
  3. RFC 5545 §3.8.5.1 — EXDATEExclusion precedence and preservation of the initial start identity.