How to format Date-Time values for iCalendar
masterWhen working with iCalendar (RFC5545) properties like DTSTART or DTEND, time values can be expressed in three distinct forms. Choosing the correct form depends on whether you are using local time, UTC, or a specific time zone reference.
- Local Time: Use this for 'floating' time where no specific time zone is attached.
- UTC Time: Append a
Zto the end of the timestamp to indicate UTC. - Local Time with Time Zone Reference: Use the
TZIDparameter to specify a time zone (e.g.,America/New_York).
Note: The TZID parameter MUST NOT be applied to DATE properties or properties already specified in UTC.
// FORM #1: DATE WITH LOCAL TIME
19980118T230000
// FORM #2: DATE WITH UTC TIME
19980119T070000Z
// FORM #3: DATE WITH LOCAL TIME AND TIME ZONE REFERENCE
TZID=America/New_York:19980119T020000