[Vobject] no TZ info in parsed dates?
Bill Janssen
janssen at parc.com
Tue Jun 9 15:04:28 CDT 2009
Here's one:
% python
Python 2.5.1 (r251:54863, Feb 6 2009, 19:02:12)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import vobject
import vobject
>>> cal = vobject.readOne(open("/tmp/simple-with-tzid.ics"))
>>> cal.vevent
<VEVENT| [<UID{}xxxx>, <DTSTART{'X-VOBJ-ORIGINAL-TZID': [u'Pacific Standard Time']}2009-05-08 14:00:00>, <DTEND{'X-VOBJ-ORIGINAL-TZID': [u'Pacific Standard Time']}2009-05-08 16:00:00>, <CLASS{}PUBLIC>, <DESCRIPTION{u'LANGUAGE': [u'en-US']}When: Friday, May 08, 2009 2:00 PM-4:00 PM (GMT-08:00) Pacific Time (US & Canada).\n\n*~*~*~*~*~*~*~*~*~*\n\n\n\n>, <DTSTAMP{}2009-04-28 15:43:57+00:00>, <LOCATION{u'LANGUAGE': [u'en-US']}2441>, <PRIORITY{}5>, <SEQUENCE{}0>, <STATUS{}CONFIRMED>, <SUMMARY{u'LANGUAGE': [u'en-US']}some arbitrary meeting>, <TRANSP{}OPAQUE>, <VALARM| [<ACTION{}DISPLAY>, <DESCRIPTION{}REMINDER>, <TRIGGER{u'RELATED': [u'START']}-1 day, 23:45:00>]>]>
>>> cal.vevent.dtstart.value
datetime.datetime(2009, 5, 8, 14, 0)
>>> cal.vevent.dtstart.value.tzinfo
>>>
And here's the original:
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
UID:xxxx
DTSTART;TZID=Pacific Standard Time:20090508T140000
DTEND;TZID=Pacific Standard Time:20090508T160000
CLASS:PUBLIC
DESCRIPTION;LANGUAGE=en-US:When: Friday\, May 08\, 2009 2:00 PM-4:00 PM (G
MT-08:00) Pacific Time (US & Canada).\n\n*~*~*~*~*~*~*~*~*~*\n\n\n\n
DTSTAMP:20090428T154357Z
LOCATION;LANGUAGE=en-US:2441
PRIORITY:5
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY;LANGUAGE=en-US:some arbitrary meeting
TRANSP:OPAQUE
BEGIN:VALARM
ACTION:DISPLAY
DESCRIPTION:REMINDER
TRIGGER;RELATED=START:-PT15M
END:VALARM
END:VEVENT
END:VCALENDAR
Bill
More information about the VObject
mailing list