date - How to match dateuilts.rrule and python icalendar daylightsavingtime aware -
i'm dealing ical problems.
i have ical event.
begin:vevent uid:event/termine/gps/akt@portal.augusta.de dtstart;tzid=cet:20150529t190000 dtend;tzid=cet:20150529t220000 categories:arbeitsgruppe dtstamp:20110620t075538z exdate;tzid=cet:20151225t190000 last-modified:20150424t201707z location:vereinsräume des augsburger computer forum e.v. priority:5 rrule:freq=monthly;byday=-1fr summary:gps-arbeitsgruppe url:https://www.augusta.de/termine/gps end:vevent
as can see there rrule repeating event every last friday of month.
i parsed ical icalendar.
i'm using:
start = iobj.get( 'dtstart' ).dt rrset = rruleset() rrule = iobj.get( 'rrule' ) exdate = iobj.get( 'exdate' ) rrset.rrule( rrule.rrulestr( rule.to_ical(), dtstart = start ) ) edate in exdate.dts : rrset.exdate( edate.dt )
everything far works fine.
when try next 10 dates with:
list(rrset)[:10]
i get:
[datetime.datetime(2015, 5, 29, 19, 0, tzinfo=<dsttzinfo 'cet' cest+2:00:00 dst>), datetime.datetime(2015, 6, 26, 19, 0, tzinfo=<dsttzinfo 'cet' cest+2:00:00 dst>), datetime.datetime(2015, 7, 31, 19, 0, tzinfo=<dsttzinfo 'cet' cest+2:00:00 dst>), datetime.datetime(2015, 8, 28, 19, 0, tzinfo=<dsttzinfo 'cet' cest+2:00:00 dst>), datetime.datetime(2015, 9, 25, 19, 0, tzinfo=<dsttzinfo 'cet' cest+2:00:00 dst>), datetime.datetime(2015, 10, 30, 19, 0, tzinfo=<dsttzinfo 'cet' cest+2:00:00 dst>), datetime.datetime(2015, 11, 27, 19, 0, tzinfo=<dsttzinfo 'cet' cest+2:00:00 dst>), datetime.datetime(2015, 12, 25, 19, 0, tzinfo=<dsttzinfo 'cet' cest+2:00:00 dst>), datetime.datetime(2016, 1, 29, 19, 0, tzinfo=<dsttzinfo 'cet' cest+2:00:00 dst>), datetime.datetime(2016, 2, 26, 19, 0, tzinfo=<dsttzinfo 'cet' cest+2:00:00 dst>)]
which seems okay on first glance, on deeper inspection there problem starting october 30th, daylight saving time ends october 25th tzinfo info of datetime object still "dsttzinfo 'cet' cest+2:00:00 dst"
the second problem 25th of december in list instead of being skipped specified in exdate. problem seams tat while parsing exdate rule daylight saving time calculated correctly , therefore exdate 19:00:00+01:00 didn't match calculated repeat time of 19:00:00+02:00.
am doing wrong there?
converting utc , processing there doesn't because 17:00:00 utc don't match 18:00:00 utc either.
Comments
Post a Comment