ICS 文件中缺少 Olsen TZ TZID 格式是否有解决方法

发布于 2024-12-05 05:36:51 字数 943 浏览 1 评论 0原文

最近,我在电子邮件中收到的 ICS 文件遇到了问题。我的 Outlook 2010 副本无法正确识别时区。以下是 ICS 文件中会议开始时间的表示方式:

DTSTART;TZID=America/Los_Angeles:20110928T183000

当 Outlook 导入此文件时,它将时间从太平洋时间下午 6:30 更改为太平洋时间晚上 7:30。经过一些实验,我能够通过更改时区格式获得在 Outlook 中正确导入的 ICS 文件:

DTSTART;TZID="Pacific Time":20110928T183000

经过进一步的研究,我发现 ICS 文件规范 未解决时区识别问题,但建议使用 Olsen TZ 数据库。 Microsoft Outlook 团队似乎选择忽略此建议。

鉴于 Outlook 是相当流行的日历客户端,是否有一种可靠的方法可以为 Outlook 格式化 ICS 时区,同时仍与其他客户端兼容?我对此问题最担心的是 Outlook 导入过程中出现无提示错误。用户很容易在错误的时间出席会议,因为 Outlook 不会发出关于时区混淆的警告。我们是否应该直接将 Outlook 用户引导至不同的文件格式?

注意:我知道这个问题与之前的帖子类似,但该帖子中的参考文献似乎已过期,我想知道是否有更好的解决方案。

I recently had a problem with an ICS file that I received in email. My copy of Outlook 2010 would not recognize the timezone correctly. Here is the way that the start time of a meeting was represented in the ICS file:

DTSTART;TZID=America/Los_Angeles:20110928T183000

When Outlook imported this file, it changed the time from 6:30 pm Pacific time to 7:30 pm Pacific time. After some experimentation I was able to get an ICS file that imported correctly in Outlook by changing the time zone format:

DTSTART;TZID="Pacific Time":20110928T183000

After some further research I found that the ICS file specification leaves the question of time zone identification open, but suggests using the Olsen TZ database. It appears that the Microsoft Outlook team has chosen to ignore this suggestion.

Given that Outlook is a fairly popular calendar client, is there a reliable way to format ICS time zones for Outlook that is still compatible with other clients? My biggest concern about this issue is the silent error during the Outlook import. Users could easily show up for a meeting at the wrong time, since Outlook gives no warning that it's confused about the time zone. Should we simply direct Outlook users to a different file format?

Note: I know that this question is similar to an earlier post, but the references on that post appear to have expired, and I'm wondering if there are any better solutions out there.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

爱*していゐ 2024-12-12 05:36:51

没有完整的 iCalendar 文件很难判断,但是您的日历文件中是否定义/是否有一个 VTIMEZONE 组件来定义 America/Los_Angeles 应该是什么?

像这样的东西:

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

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
玩心态 2024-12-12 05:36:51

与其将时区定义添加到 ics 文件中,不如在 UTC 本身中提及事件开始/结束时间。
然后,ICS 文件的使用者(在您的情况下为 Outlook)应该能够在将会议事件呈现在其日历上之前,将时区从 UTC(来自 ics 文件)转换为最终用户的首选时区设置。

优点:
这样您就不必自己添加正确的时区偏移(VTIMEZONE 组件)。
另外,ics 文件更小、更干净、更易于阅读。

参考文献:
甚至 google 似乎也在以这种方式处理 ics 中的时区 - Google 时区处理

希望这会有所帮助。

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.

以往的大感动 2024-12-12 05:36:51

假设提问者住在洛杉矶并使用 OUTLOOK2010。
并且 20110928T183000 开始时间基于 PDT
如果您想让会议成功,您可以在描述中添加会议预约项目、联系人和谷歌地图 URL 地址电话开放时间。
当然,会议项目应该添加组织者和参加者,但是很难设置。
并且大约75个八位位组的回车和插入空格是困难的。所以只设置组织者和参加者在描述中写入。

BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN
VERSION:2.0
CALSCALE:GREGORIAN
X-WR-TIMEZONE:America/Los_Angeles
BEGIN:VTIMEZONE
TZID:America/Los_Angeles
X-WR-TIMEZONE: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
BEGIN:VEVENT
DTSTART;TZID=America/Los_Angeles:20110928T183000
DTEND;TZID=America/Los_Angeles:20110928T203000
LOCATION:meeting room in Los Angeles
Description:maps link \nhttp... \n phone \n open at 10:00:AM(PDT)
UID:ev1
ORGANIZER;CN="ThisMeeting Orginizer":mailto:[email protected]
Contact:[email protected]
DTSTAMP:20111001T105433Z
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR

Suppose the questioner lives in Los Angeles and uses OUTLOOK2010.
And 20110928T183000 Start time is based on PDT
If you want to make meeting successful, You add Meeting appointment item, contact, and google map URL Address phone open time in description.
Of course, meeting item should add Organizer and Attendee, but it is so hard to set.
And about 75 octet carriage return and inserting space is difficult. So only set organizer and attendee write in description.

BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN
VERSION:2.0
CALSCALE:GREGORIAN
X-WR-TIMEZONE:America/Los_Angeles
BEGIN:VTIMEZONE
TZID:America/Los_Angeles
X-WR-TIMEZONE: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
BEGIN:VEVENT
DTSTART;TZID=America/Los_Angeles:20110928T183000
DTEND;TZID=America/Los_Angeles:20110928T203000
LOCATION:meeting room in Los Angeles
Description:maps link \nhttp... \n phone \n open at 10:00:AM(PDT)
UID:ev1
ORGANIZER;CN="ThisMeeting Orginizer":mailto:[email protected]
Contact:[email protected]
DTSTAMP:20111001T105433Z
TRANSP:OPAQUE
END:VEVENT
END:VCALENDAR
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文