You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to parse iCalendar file, generated by Microsoft Outlook 2016.
While parsing itself works fine, I did stuck with the timezone.
The calendar header(excluding events) looks like this:
BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 16.0 MIMEDIR//EN
VERSION:2.0
METHOD:PUBLISH
X-CALSTART:20190527T093000Z
X-CALEND:20190614T170000Z
X-CLIPSTART:20190430T210000Z
X-CLIPEND:20190616T210000Z
X-WR-RELCALID:{0000002E-65C8-5317-F094-6C7ABA69683A}
X-WR-CALNAME:Schedule
BEGIN:VTIMEZONE
TZID:Russian Standard Time
BEGIN:STANDARD
DTSTART:16010101T000000
TZOFFSETFROM:+0300
TZOFFSETTO:+0300
END:STANDARD
END:VTIMEZONE
BEGIN:VTIMEZONE
TZID:Unnamed Time Zone 1
BEGIN:STANDARD
DTSTART:16010101T000000
TZOFFSETFROM:+0300
TZOFFSETTO:+0300
END:STANDARD
END:VTIMEZONE
As dateutil.tz.gettz() returns None to Russian Standard Time in parser: https://github.com/irgangla/icalevents/blob/master/icalevents/icalparser.py#L224
it all falls back to the UTC. However, why don't you check offset value?
From what it seems, solemnly relying on value of TZID is not safe.
Also, you might provide ability to override timezone via argument of events function.
The text was updated successfully, but these errors were encountered:
>>>fromdateutil.tzimportgettz>>>type(gettz('Russian Standard Time'))
<class'NoneType'>>>>type(gettz('FLE Standard Time'))
<class'NoneType'>>>>type(gettz('UTC'))
<class'dateutil.tz.tz.tzfile'>
I'm trying to parse iCalendar file, generated by Microsoft Outlook 2016.
While parsing itself works fine, I did stuck with the timezone.
The calendar header(excluding events) looks like this:
As
dateutil.tz.gettz()
returnsNone
toRussian Standard Time
in parser: https://github.com/irgangla/icalevents/blob/master/icalevents/icalparser.py#L224it all falls back to the UTC. However, why don't you check offset value?
From what it seems, solemnly relying on value of
TZID
is not safe.Also, you might provide ability to override timezone via argument of
events
function.The text was updated successfully, but these errors were encountered: