无效的属性:使用PHP生成的.ics文件的TZID

时间:2017-01-22 20:14:07

标签: php timezone icalendar

我正在尝试创建一个有效的.ics文件,但是当我尝试验证它时,我收到以下错误:

Error:  Error was: Invalid property: TZID
Cause:  Sorry, I couldn't get an exact cause.
(when tested on this page: http://severinghaus.org/projects/icv/)

我的.ics文件如下所示:

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//BenchApp/BAcal//NONSGML v1.0//EN
CALSCALE:GREGORIAN
TZID:America/Vancouver
X-WR-TIMEZONE:America/Vancouver
X-WR-CALNAME:Beavers
X-WR-CALDESC:Team Schedule
BEGIN:VEVENT
DTEND:20160913T220000
UID:58756a0d39f0e
DTSTAMP:20160913T200000
SUMMARY:Hornets vs. Beavers
LOCATION:Thunderbird
URL;VALUE=URI:http://www.benchapp.com/schedule/game-81915
DTSTART:20160913T200000
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20160922T203000
UID:58756a0d3a069
DTSTAMP:20160922T183000
SUMMARY:Beavers vs. Thrashers
LOCATION:Thunderbird
URL;VALUE=URI:http://www.benchapp.com/schedule/game-86585
DTSTART:20160922T183000
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20160929T001500
UID:58756a0d3a187
DTSTAMP:20160928T221500
SUMMARY:Meh8s vs. Beavers
LOCATION:Father Bauer
URL;VALUE=URI:http://www.benchapp.com/schedule/game-86586
DTSTART:20160928T221500
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20161002T170000
UID:58756a0d3a27a
DTSTAMP:20161002T150000
SUMMARY:Predators vs. Beavers
LOCATION:Thunderbird
URL;VALUE=URI:http://www.benchapp.com/schedule/game-86587
DTSTART:20161002T150000
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20161015T231500
UID:58756a0d3a3d8
DTSTAMP:20161015T220000
SUMMARY:Beavers vs. Cutting Edges Beircraft
LOCATION:Father Bauer
URL;VALUE=URI:http://www.benchapp.com/schedule/game-98117
DTSTART:20161015T220000
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20161019T224500
UID:58756a0d3a52c
DTSTAMP:20161019T213000
SUMMARY:Thrashers vs. Beavers
LOCATION:Thunderbird
URL;VALUE=URI:http://www.benchapp.com/schedule/game-98118
DTSTART:20161019T213000
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20161023T204500
UID:58756a0d3a667
DTSTAMP:20161023T193000
SUMMARY:No Ma'am vs. Beavers
LOCATION:Thunderbird
URL;VALUE=URI:http://www.benchapp.com/schedule/game-98119
DTSTART:20161023T193000
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20161103T211500
UID:58756a0d3a7a5
DTSTAMP:20161103T200000
SUMMARY:Lululemon Wreckers vs. Beavers
LOCATION:Thunderbird
URL;VALUE=URI:http://www.benchapp.com/schedule/game-98120
DTSTART:20161103T200000
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20161117T224500
UID:58756a0d3a930
DTSTAMP:20161117T213000
SUMMARY:Beavers vs. Predators
LOCATION:Thunderbird
URL;VALUE=URI:http://www.benchapp.com/schedule/game-98122
DTSTART:20161117T213000
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20161120T204500
UID:58756a0d3aa57
DTSTAMP:20161120T193000
SUMMARY:Meh8s vs. Beavers
LOCATION:Thunderbird
URL;VALUE=URI:http://www.benchapp.com/schedule/game-98123
DTSTART:20161120T193000
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20161130T220000
UID:58756a0d3ab66
DTSTAMP:20161130T204500
SUMMARY:Cutting Edges Beircraft vs. Beavers
LOCATION:Father Bauer
URL;VALUE=URI:http://www.benchapp.com/schedule/game-98124
DTSTART:20161130T204500
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20161203T191500
UID:58756a0d3ac75
DTSTAMP:20161203T180000
SUMMARY:Beavers vs. Thrashers
LOCATION:Thunderbird
URL;VALUE=URI:http://www.benchapp.com/schedule/game-98125
DTSTART:20161203T180000
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20161210T161500
UID:58756a0d3adc9
DTSTAMP:20161210T150000
SUMMARY:Beavers vs. No Ma'am
LOCATION:Thunderbird
URL;VALUE=URI:http://www.benchapp.com/schedule/game-98126
DTSTART:20161210T150000
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20161216T220000
UID:58756a0d3aec3
DTSTAMP:20161216T204500
SUMMARY:Beavers vs. Lululemon Wreckers
LOCATION:Father Bauer
URL;VALUE=URI:http://www.benchapp.com/schedule/game-98127
DTSTART:20161216T204500
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20170104T233000
UID:58756a0d3afb2
DTSTAMP:20170104T221500
SUMMARY:Beavers vs. Hornets
LOCATION:Father Bauer
URL;VALUE=URI:http://www.benchapp.com/schedule/game-115210
DTSTART:20170104T221500
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20170108T174500
UID:58756a0d3b12a
DTSTAMP:20170108T163000
SUMMARY:Beavers vs. No Ma'am
LOCATION:UBC Thunderbird, 6066 Thunderbird Blvd., Vancouver, BC, Canada
URL;VALUE=URI:http://www.benchapp.com/schedule/game-115211
DTSTART:20170108T163000
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20170121T114500
UID:58756a0d3b258
DTSTAMP:20170121T103000
SUMMARY:No Ma'am vs. Beavers
LOCATION:UBC Thunderbird, 6066 Thunderbird Blvd., Vancouver, BC, Canada
URL;VALUE=URI:http://www.benchapp.com/schedule/game-115212
DTSTART:20170121T103000
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20170127T220000
UID:58756a0d3b3a4
DTSTAMP:20170127T204500
SUMMARY:Lululemon Wreckers vs. Beavers
LOCATION:Father Bauer
URL;VALUE=URI:http://www.benchapp.com/schedule/game-115213
DTSTART:20170127T204500
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20170207T194500
UID:58756a0d3b4e4
DTSTAMP:20170207T183000
SUMMARY:Beavers vs. Hornets
LOCATION:Thunderbird
URL;VALUE=URI:http://www.benchapp.com/schedule/game-115214
DTSTART:20170207T183000
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20170212T161500
UID:58756a0d3b710
DTSTAMP:20170212T150000
SUMMARY:Beavers vs. Predators
LOCATION:Thunderbird
URL;VALUE=URI:http://www.benchapp.com/schedule/game-115215
DTSTART:20170212T150000
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20170219T144500
UID:58756a0d3b8e5
DTSTAMP:20170219T133000
SUMMARY:Meh8s vs. Beavers
LOCATION:Thunderbird
URL;VALUE=URI:http://www.benchapp.com/schedule/game-115216
DTSTART:20170219T133000
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20170221T224500
UID:58756a0d3baeb
DTSTAMP:20170221T213000
SUMMARY:Beavers vs. Hornets
LOCATION:Thunderbird
URL;VALUE=URI:http://www.benchapp.com/schedule/game-115217
DTSTART:20170221T213000
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20170228T211500
UID:58756a0d3bcd6
DTSTAMP:20170228T200000
SUMMARY:Cutting Edges Beircraft vs. Beavers
LOCATION:Thunderbird
URL;VALUE=URI:http://www.benchapp.com/schedule/game-115218
DTSTART:20170228T200000
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20170309T224500
UID:58756a0d3bec7
DTSTAMP:20170309T213000
SUMMARY:Beavers vs. No Ma'am
LOCATION:Thunderbird
URL;VALUE=URI:http://www.benchapp.com/schedule/game-115219
DTSTART:20170309T213000
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20170317T233000
UID:58756a0d3c08e
DTSTAMP:20170317T221500
SUMMARY:Beavers vs. Lululemon Wreckers
LOCATION:Father Bauer
URL;VALUE=URI:http://www.benchapp.com/schedule/game-115220
DTSTART:20170317T221500
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20170322T211500
UID:58756a0d3c1af
DTSTAMP:20170322T200000
SUMMARY:Hornets vs. Beavers
LOCATION:Thunderbird
URL;VALUE=URI:http://www.benchapp.com/schedule/game-115221
DTSTART:20170322T200000
LAST-MODIFIED:20170110T151109
END:VEVENT
BEGIN:VEVENT
DTEND:20170324T233000
UID:58756a0d3c2e3
DTSTAMP:20170324T221500
SUMMARY:Predators vs. Beavers
LOCATION:Father Bauer
URL;VALUE=URI:http://www.benchapp.com/schedule/game-115222
DTSTART:20170324T221500
LAST-MODIFIED:20170110T151109
END:VEVENT
END:VCALENDAR

有人能发现可能与我的时区设置有关的问题吗?

干杯!

1 个答案:

答案 0 :(得分:1)

在VCALENDAR级别确实没有TZID属性,所以它抱怨第5行:

TZID:America/Vancouver

另一方面,您的所有DTSTART和DTEND都应具有TZID参数,例如

DTSTART;TZID=America/Vancouver:20160922T183000

理论上,您的文件也应该以对应于此特定时区的VTIMEZONE定义开头。如果没有正确的定义,有些客户可能不喜欢TZID。