Is There a Workaround for lack of Olsen TZ TZID Format in ICS File

风格不统一 提交于 2019-11-29 09:25:27
Auberon Vacher

Hard to judge without the full iCalendar file but did you define/do you have a VTIMEZONE component in your calendar file which defines what America/Los_Angeles should be?

Something like:

BEGIN:VTIMEZONE
TZID:America/Los_Angeles
BEGIN:DAYLIGHT
TZOFFSETFROM:-0800
TZOFFSETTO:-0700
TZNAME:PDT
DTSTART:19700308T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=2SU
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:-0700
TZOFFSETTO:-0800
TZNAME:PST
DTSTART:19701101T020000
RRULE:FREQ=YEARLY;BYMONTH=11;BYDAY=1SU
END:STANDARD
END:VTIMEZONE

Instead of adding the timezone definition to the ics file, it would be better to mention the event start/end times in UTC itself. And then, the consumer of the ICS file - outlook in your case - should be able to do the timezone conversion from UTC(from ics file) to the preferred timezone setting of the end user, just before rendering the meeting event on their calendars.

Pros: This way you dont have to take care of adding the correct timezone offsets (VTIMEZONE component) yourself. Plus, the ics file is much smaller, cleaner, easy to read.

References: Even google seems to be handling timezones in ics this way itself - Google timezone handling

Hope this helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!