php - 如何在 vcalendar 中处理日光和标准时间之间的切换?
问题描述
生成的代码仅适用于当前时区(日光或标准时间)。当我将会议 Outlook 从标准时间发送到夏令时(反之亦然)时,Outlook 会更正会议并将其向前移动 1 小时。
Outlook 将其更正如下:此会议是根据您当前的时区自定义的。最初是在这个时区创建的:欧洲/布拉格。
我发送会议 - 6.5.2020:8-9am,但在 Outlook 中是 6.5.2020:9-10am
Outlook 或我的代码有问题吗?塔克你的任何帮助...
这是 php (7) 中的脚本,用于从特定的 xml 源收集事物数据。我需要将它们发送到 Outlook 日历中。我们正在使用 Outlook 2016 和 365。
function setICalendar(){
$this->strICalendarClass="\nBEGIN:VCALENDAR\nMETHOD:REQUEST";
$this->strICalendarClass.="\nBEGIN:VTIMEZONE\nTZID:Europe/Prague";
$this->strICalendarClass.="\nX-LIC-LOCATION:Europe/Prague";
$this->strICalendarClass.="\nBEGIN:STANDARD";
$this->strICalendarClass.="\nDTSTART:19411001T000000";
$this->strICalendarClass.="\nTZOFFSETFROM:0000\nTZOFFSETTO:0000\nTZNAME:Standard Time";
$this->strICalendarClass.="\nRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10";
$this->strICalendarClass.="\nCET";
$this->strICalendarClass.="\nEND:STANDARD";
$this->strICalendarClass.="\nBEGIN:DAYLIGHT";
$this->strICalendarClass.="\nDTSTART:19860504T000000";
$this->strICalendarClass.="\nTZOFFSETFROM:-0200\nTZOFFSETTO:-0100\nTZNAME:Daylight Savings Time";
$this->strICalendarClass.="\nRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3";
$this->strICalendarClass.="\nCEST";
$this->strICalendarClass.="\nEND:DAYLIGHT\nEND:VTIMEZONE";
$this->strVEvent="\nBEGIN:VEVENT";
nBEGIN:VCALENDAR
METHOD:REQUEST;
BEGIN:VTIMEZONE
TZID:Europe/Prague;
X-LIC-LOCATION:Europe/Prague;
BEGIN:STANDARD";
DTSTART:19411001T000000;
TZOFFSETFROM:0000
TZOFFSETTO:0000
TZNAME:Standard Time;
RULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10;
CET;
END:STANDARD;
BEGIN:DAYLIGHT;
DTSTART:19860504T000000;
TZOFFSETFROM:-0200
TZOFFSETTO:-0100
TZNAME:Daylight Savings Time;
RULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3;
CEST;
END:DAYLIGHT;
END:VTIMEZONE;
我希望在开始和展望中同时出现。
解决方案
我修理它,像这样,一切正常。
$this->strICalendarClass="\nBEGIN:VCALENDAR\nMETHOD:REQUEST";
$this->strICalendarClass.="\nBEGIN:VTIMEZONE\nTZID:Europe/Prague";
$this->strICalendarClass.="X-LIC-LOCATION:Europe/Prague";
$this->strICalendarClass.="\nBEGIN:STANDARD";
$this->strICalendarClass.="\nDTSTART:19411001T000000";
$this->strICalendarClass.="\nTZOFFSETFROM:-0100\nTZOFFSETTO:0000\nTZNAME:Standard Time";
$this->strICalendarClass.="\nRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10";
$this->strICalendarClass.="\nCET";
$this->strICalendarClass.="\nEND:STANDARD";
$this->strICalendarClass.="\nBEGIN:DAYLIGHT";
$this->strICalendarClass.="\nDTSTART:20140330T030000";
$this->strICalendarClass.="\nTZOFFSETFROM:0000\nTZOFFSETTO:+0100\nTZNAME:Daylight Savings Time";
$this->strICalendarClass.="\nRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3";
$this->strICalendarClass.="\nCEST";
$this->strICalendarClass.="\nEND:DAYLIGHT\nEND:VTIMEZONE";
推荐阅读
- java - 图形上下文、Netbeans 和“曲线”线
- powershell - Powershell脚本退出差异
- scala - Spark INFO spark.MapOutputTrackerMasterEndpoint:被要求发送 shuffle 0 的地图输出位置永远慢
- c++ - 为什么在 for 循环中更改变量后变量不改变?
- sql - 给定月份 + 上个月的 SUM 值
- git - 如何在 docker 容器中设置 git?
- mysql - 选择子表中具有特定 id 的行的总和并将其与父表进行比较
- oauth-2.0 - Keycloak 中有没有办法将访问令牌另外存储到外部数据库中?
- python - 如何对数据使用条件格式?
- prometheus - 将 Prometheus 服务器的刮擦时间戳记录到我的客户端