datedatetimetimeicalendarrfc5545

Formatting time for ical export


I have created a calendar in jquery that exports to ical. However, I am having some issues with the datetime.

The ical export script expects the date/time in this format: 19970714T170000Z.

Does anybody know what this is and how I should prepare my string?

Thanks


Solution

  • Reading the RFC (link) gives :

    3.3.5. Date-Time

    [...]

    date-time = date "T" time

    The "DATE-TIME" value type expresses time values in three forms:

    FORM #1: DATE WITH LOCAL TIME For example, the following represents January 18, 1998, at 11 PM: 19980118T230000

    FORM #2: DATE WITH UTC TIME CAPITAL LETTER Z suffix character, to the time value.
    For example, the following represents January 19, 1998, at 0700 UTC: 19980119T070000Z

    FORM #3: DATE WITH LOCAL TIME AND TIME ZONE REFERENCE TZID=America/New_York:19980119T020000

    DTSTART:19970714T133000 ; Local time DTSTART:19970714T173000Z ; UTC time DTSTART;TZID=America/New_York:19970714T133000 ; Local time and time ; zone reference