r1 - 05 Mar 2007 - 15:06:53 - JeffreyHarrisYou are here: OSAF >  Journal Web  > ArbitraryTimezones

Handling arbitrary iCalendar timezones

When importing icalendar events, Chandler follows the following strategy (go here if you want to see the Python):
  1. Look at the transition times in and out DST for the year in which the event starts. Compare these to those transition dates and times in all Olson timezones that have the same non-DST offset.
    1. It's not easy in Python to find out DST transitions, the API maps datetime -> offset, so we look at every month (in search of a DST transition), then look at every day in the transition month, etc.
  2. If a match is found, great, done. That's all we can really check, because iCalendar only requires a VTIMEZONE to have DST transitions if they apply to the event. In fact, if the event doesn't recur, it's legal to not include a meaningful DST timezone transition, but in practice, this matches most VTIMEZONEs
  3. except that Exchange is currently serializing US timezones as if the 2007 DST transitions started in 1601, so if we get an event in the past, we won't find a matching timezone. As a fallback, we check the timezone definition for 2007
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r1 | More topic actions
 
Open Source Applications Foundation
Except where otherwise noted, this site and its content are licensed by OSAF under an Creative Commons License, Attribution Only 3.0.
See list of page contributors for attributions.