opyebCronPulse

Exporting RRULE as .ics: TZID and VTIMEZONE explained

RRULE · 7 min read

One-line answer: How to write .ics files so calendar apps show the right time, including TZID, VTIMEZONE, UTC form and line folding.

Exporting an RRULE as .ics makes it importable into Google Calendar, Apple Calendar and Outlook. Get the time zone wrong and every occurrence shifts by an hour, or the DST change lands on the wrong day. The two keys are TZID and VTIMEZONE.

Minimal .ics structure

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//OPYEB//CronPulse//EN
BEGIN:VTIMEZONE
TZID:Asia/Seoul
...
END:VTIMEZONE
BEGIN:VEVENT
UID:example-cronpulse-1
DTSTAMP:20261129T000000Z
DTSTART;TZID=Asia/Seoul:20261201T090000
DTEND;TZID=Asia/Seoul:20261201T093000
RRULE:FREQ=WEEKLY;BYDAY=MO,WE
SUMMARY:Release window
END:VEVENT
END:VCALENDAR

Adding TZID to DTSTART says “this is a wall-clock time in that zone”. The calendar app uses VTIMEZONE to work out the real UTC offset. Without VTIMEZONE the app may guess, and guesses differ.

The UTC alternative

DTSTART:20261201T000000Z is UTC and needs no VTIMEZONE. It never meets a DST transition. UTC is safest for machine-to-machine exchange; the calendar app still displays it in the viewer's local time.

Line endings and folding

RFC 5545 requires CRLF line endings and lines of at most 75 octets. Long SUMMARY or DESCRIPTION values are folded onto the next line with a leading space. Korean, Japanese and Chinese characters are three octets each, so folding must never split a character; fold on character boundaries.

FormStrengthCaution
TZID + VTIMEZONEkeeps the local wall clockwithout VTIMEZONE it shifts by an hour
UTC (Z)DST-proof, safe between systemsviewers see it converted
local time onlylooks simpledifferent devices interpret it differently

What to check in the calendar

  • The first occurrence matches DTSTART.
  • Times on DST transition days stay at the intended wall-clock hour.
  • UNTIL was interpreted as UTC and did not slip a day.
  • The app shows the event as a repeating series.

CronPulse observes the zone's real transitions to build VTIMEZONE and folds lines at 75 octets. Importing the downloaded file and checking the first few occurrences is the most reliable test.

Paste an expression and see its next run times right away.

Open CronPulse

Frequently asked questions

What goes wrong without VTIMEZONE?

The app may treat the time as UTC or as its default zone, shifting occurrences by the offset, and DST transition days can move by an hour.

Why won't my .ics file open?

The usual causes are LF-only line endings, missing BEGIN/END:VCALENDAR, or a UTF-8 BOM at the start. Check CRLF and the wrapper lines first.

Sources

Related reading