iCal file Timezones

Parsing the Timezone of the calendar file is one of the challenges in coping with the variety of ical files around.

The ical spec allows for a full definition of the timezone, that should include a TZID

BEGIN:VTIMEZONE
TZID:US-Eastern

…etc

Some mozilla calendars generate something like this:

BEGIN:VTIMEZONE
TZID:/mozilla.org/20070129_1/Europe/Berlin

Many  Ical generators (such as Apple Ical 4.0.1) also offer something like this, outside of the Timezone complete definition:

X-WR-TIMEZONE:Europe/Zurich

I have just discovered that fbcalendar does this as the only file level timezone definition.. This seems possibly dubious?  I cannot find any clarity on this.  Most of the Apple and Google files I see NOT do the VALUE=TEXT part. and some other ical parsers question it.  On the other hand if it is a “private extension”, it can do almost anything? and the parsers just have to deal with it if they want to handle that type of file.

X-WR-TIMEZONE;VALUE=TEXT:Europe/Oslo

fbcalendar (a facebook application) also then seems to issue it’s event definitions as “floating” (or perhaps this is a setup per account?).  This may result in incorrect results.

Facebook.com does not identify the timezone at file level, but at least does issue a timezone defined date in UTC zone:

DTSTAMP:20100108T161540Z

Some, such as mozilla again or Artist Data provide no overall timezone information at all.  This is okay, so long as there is adequate information in the events.

Timezone per event

The timezone can also be specified for each event with the date and/or time is specified

DTSTART;TZID=Europe/Zurich:20071022T200000

DTSTART;VALUE=DATE;TZID=/mozilla.org/20070129_1/Europe/Berlin:20061223

Or again, not at all, either because

  • the event is “floating” , for example a personal reminder which is at local time wherever you are, or
  • it is universal, for example a anniversary or birthday

DTSTART:20100411T090000   (floating)

DTSTART;VALUE=DATE:20100415

Note: The ‘X-’ items are private extensions to the ical file.   Some more consistently or meaningfully implemented than others.  For example:  WHY this

X-WR-TIMEZONE;VALUE=TEXT:Europe/Oslo

when other do this:

X-WR-TIMEZONE:Europe/Zurich

About anmari

the developer at anmari
This entry was posted in Notes. Bookmark the permalink.