[icalendar-dev] Handling timezones in dtstart/dtend

Sidnei da Silva sidnei at enfoldsystems.com
Thu Feb 23 01:08:13 CET 2006


On Wed, Feb 22, 2006 at 03:29:48PM -0800, Tessa Lau wrote:
| 
| Hi,
| 
| I'm really happy to see that someone's writing an iCalendar library
| for Python!  I've done my share of writing simple ical parsers and
| generators, so I appreciate the effort that's gone into this.
| 
| I'm running into a problem with parsing iCalendar data files generated
| by Lotus Notes (example attached).  These calenders specify the
| datestart and dateend using a custom timezone that's defined earlier
| in the .ics file.  However, the parser doesn't seem to handle these
| timezones correctly, and gives me a naive datetime object rather than
| a timezone-aware datetime.
| 
| What I think should happen is that the parser should recognize that
| the timezone is specified as a parameter on the dtstart property, and
| retrieve that timezone from where it was specified earlier in the
| calendar data.
| 
| Alternatively, I can look for the presence of this TZID property, and
| parse out the timezone info myself, and convert the naive datetime to
| an aware datetime.  However, it seems like this should be handled by
| the iCalendar library.
| 
| What do you think?

For the records, the 'DateUtil' python package can create a timezone
object from a ical file. That's what I'm using.

http://labix.org/python-dateutil

-- 
Sidnei da Silva
Enfold Systems, LLC.
http://enfoldsystems.com



More information about the icalendar-dev mailing list