我创建了一个应用程序来管理立陶宛的约会。我设法将
.ics
文件附加到电子邮件中,客户可以在其中看到他们即将进行的约会。我注意到一些非它或只是暂时访问该国家/地区的用户在其设备上设置了其他时区,这大多数时候使他们感到困惑。是否可以将显示的时区固定为Europe/Vilnius
?
这是同一电子邮件中的
.ics
附件:
BEGIN:VCALENDAR
VERSION:2.0
CALSCALE:GREGORIAN
PRODID:grozissaviems
X-WR-TIMEZONE:Europe/Vilnius
METHOD:PUBLISH
BEGIN:VTIMEZONE
TZID:Europe/Vilnius
X-LIC-LOCATION:Europe/Vilnius
END:VTIMEZONE
BEGIN:VEVENT
UID:[email protected]
SEQUENCE:0
SUMMARY:Testavimo paslauga
DTSTAMP:20240514T124512Z
DTSTART:20240515T130000Z
DTEND:20240515T140000Z
DESCRIPTION:Daugiau informacijos http://local.grozissaviems.lt/premium/vizitai
LOCATION:Vilniaus g. 38\, Telšiai\, Telšių rajono savivaldybė\, Lietuva
STATUS:CONFIRMED
BEGIN:VALARM
TRIGGER:-PT30M
ACTION:DISPLAY
END:VALARM
END:VEVENT
END:VCALENDAR
DTSTART
和 DTEND
是采用 Ymd\THis\Z
格式的 UTC 日期。
我也尝试了以下方法,但不起作用:
DTSTART;TZID=Europe/Vilnius:20240515T130000
BEGIN:VCALENDAR
VERSION:2.0
CALSCALE:GREGORIAN
PRODID:grozissaviems
X-WR-TIMEZONE:Europe/Vilnius
METHOD:PUBLISH
BEGIN:VTIMEZONE
TZID:Europe/Vilnius
X-LIC-LOCATION:Europe/Vilnius
# Added standard time definition to clarify the timezone details.
BEGIN:STANDARD
DTSTART:20240515T130000
TZOFFSETFROM:+0300
TZOFFSETTO:+0300
TZNAME:EET
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
UID:[email protected]
SEQUENCE:0
SUMMARY:Testavimo paslauga
DTSTAMP:20240514T124512Z
# Removed 'Z' suffix.
# 'Z' suffix indicates UTC time, which was causing confusion
# as it didn't specify the Europe/Vilnius timezone.
DTSTART;TZID=Europe/Vilnius:20240515T130000
DTEND;TZID=Europe/Vilnius:20240515T140000
DESCRIPTION:Daugiau informacijos http://local.grozissaviems.lt/premium/vizitai
LOCATION:Vilniaus g. 38\, Telšiai\, Telšių rajono savivaldybė\, Lietuva
STATUS:CONFIRMED
BEGIN:VALARM
TRIGGER:-PT30M
ACTION:DISPLAY
END:VALARM
END:VEVENT
END:VCALENDAR