Exporting RRULE as .ics: TZID and VTIMEZONE explained
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.
| Form | Strength | Caution |
|---|---|---|
| TZID + VTIMEZONE | keeps the local wall clock | without VTIMEZONE it shifts by an hour |
| UTC (Z) | DST-proof, safe between systems | viewers see it converted |
| local time only | looks simple | different 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 CronPulseFrequently 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
- Cron in five fields: minute, hour, day, month, weekdayWhat each of the five Unix cron fields means, which values are allowed, and how to read an expression without guessing.
- Cron special characters: *, /, -, commas, ?, L, W and #The eight symbols that make cron expressive, what each one means, and where implementations disagree.
- Five-field Unix cron versus six-field Quartz and EventBridgeSeconds, weekday numbers, the ? rule and the year field: what changes when you move a schedule between cron dialects.
- Daylight saving and cron: the day 02:30 disappearsHow clock changes affect cron runs, and how to move jobs out of the 2–3 AM danger window.