没有在Office 365中正确创建全天事件 [英] All-day events are not created correctly in Office 365

查看:152
本文介绍了没有在Office 365中正确创建全天事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过自己的REST API导出一些事件在Office 365日历,<一个href=\"https://msdn.microsoft.com/office/office365/APi/calendar-rest-operations#EventoperationsCreateevents\" rel=\"nofollow\">https://msdn.microsoft.com/office/office365/APi/calendar-rest-operations#EventoperationsCreateevents.

I am trying to export some events to a calendar in Office 365 through their REST API, https://msdn.microsoft.com/office/office365/APi/calendar-rest-operations#EventoperationsCreateevents.

我设置了​​ IsAllDay 为真,并设置开始和结束在午夜UTC。

I set the IsAllDay to true, and set the start and end to midnight in UTC.

有效载荷看起来是这样的:

The payload looks like this:

{
  "Body": {
    "Content": "Agenda",
    "ContentType": "HTML"
  },
  "End": "2015-02-01T00:00:00Z",
  "ShowAs": "Busy",
  "Start": "2015-01-30T00:00:00Z",
  "ChangeKey": "X2+akAeClEa0OJ8r6nC5QgABW30vaQ==",
  "Location": {
    "DisplayName": "Vesterbrogade"
  },
  "Subject": "Updated title",
  "IsAllDay": true
}

这看起来不错,如果我再次得到事件,有效载荷回来为集。然而,当我去outlook.office365.com事件现在已经扩展到2天,而不是1如预期。然而,时间显示为1天。 Unclicking Outlook中的一整天,揭示的问题。由于我在欧洲中部时间,我比UTC早一个小时。开始显示为2015年1月30日01:00结束的2015年2月1日0时59分。所以,下面的盖子它似乎并没有被存储在我的时区全天事件。

That looks fine, and if I GET the event again, the payload comes back as set. However when I go to outlook.office365.com the event now spans 2 days, instead of 1 as intended. The duration however appears as 1 day. Unclicking the "all day" in Outlook reveals the problem. Since I am in Central European Time, I'm one hour ahead of UTC. The start shows as 2015-01-30 01:00 and the end as 2015-02-01 00:59. So underneath the covers it doesn't seem to be stored as an all day event in my timezone.

当您使用f.ex. EWS,您通常设定为会议的时区,但是这似乎并不可能。

When you use f.ex. EWS, you normally set the timezone of the meeting, however that doesn't appear to be possible.

我试图给开端,以区信息结束,但我得到一个400告诉我,它在UTC供给。所以,据我可以告诉有什么我可以,期待希望微软修复此。还是我失去了一些东西?

I have tried to give the start and end with timezone information, but I get a 400 telling me it has to be supplied in UTC. So as far as I can tell there is nothing I can, expect hope that Microsoft fixes this. Or am I missing something?

编辑:其实事件在Outlook中显示正确的Mac,所以,这可能在outlook.office365.com只在OWA的一个问题。

The event actually appears correctly in Outlook for Mac, so perhaps this is only a problem in the OWA at outlook.office365.com.

推荐答案

该API现在支持时区。你会怎样想在这里做的是没有指定开始结束作为UTC(用'Z'$表示p $上月底PFIX),而是在您的时区指定它。然后,您可以设置 StartTimeZone EndTimeZone 值欧洲中部时间。因此,像这样:

The API now supports time zones. What you would want to do here is not specify your Start and End as UTC (indicated by the 'Z' prefix on the end), but instead specify it in your time zone. You would then set the StartTimeZone and EndTimeZone values to "Central European Time". So something like this:

{
  "Body": {
    "Content": "Agenda",
    "ContentType": "HTML"
  },
  "Start": "2015-01-30T00:00:00+01:00",
  "End": "2015-02-01T00:00:00+01:00",
  "ShowAs": "Busy",
  "Location": {
    "DisplayName": "Vesterbrogade"
  },
  "Subject": "Updated title",
  "IsAllDay": true,
  "StartTimeZone": "Central European Standard Time",
  "EndTimeZone": "Central European Standard Time"
}

这篇关于没有在Office 365中正确创建全天事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆