-
Notifications
You must be signed in to change notification settings - Fork 14
Description
Quick Summary
For an old appointment (from an old calendar) from before the year 2000 the generated VTIMEZONE does not match the datetime.
Context
- vObject version 1.0.0 with recent patch for TZID, see Collision on TZID with short timezone names #117
- Python version 3.13
- Operating system and version: Debian 13.1 aka Trixie
Description
When I have times in a VEVENT before the year 2000 the automatically generated VTIMEZONE starts 2000.
This is especially important for times before 1980 since in most european countries there was no daylight saving time before 1980 (unless you go back to the 1940s). The Unix/Linux timezone info has the full picture, so vobject should export this correctly depending on the used datetime(s).
To Reproduce
import vobject
import datetime
from zoneinfo import ZoneInfo
cal = vobject.iCalendar ()
vev = cal.add ('vevent')
tz = ZoneInfo ('Europe/Vienna')
vev.add ('dtstart').value = datetime.datetime (1970, 1, 1, tzinfo = tz)
vev.add ('dtend').value = datetime.datetime (1970, 8, 7, tzinfo = tz)
vev.add ('uid').value = 'Sample UID'
print (cal.serialize ())
yields the following, observe that the DTSTART of the VTIMEZONE is in the year 2000 while the VEVENT is in 1970. In 1970 Europe/Vienna doesn't have daylight savings.
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//PYVOBJECT//NONSGML Version 0.9.9//EN
BEGIN:VTIMEZONE
TZID:Europe/Vienna
BEGIN:STANDARD
DTSTART:20001029T040000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10
TZNAME:CET
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:20000326T030000
RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3
TZNAME:CEST
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
UID:Sample UID
DTSTART;TZID=Europe/Vienna:19700101T000000
DTEND;TZID=Europe/Vienna:19700807T000000
DTSTAMP:20250910T172032Z
END:VEVENT
END:VCALENDAR
I would be quite happy if there is a way to do this manually -- in fact very old appointments might not be the common use-case.