0

当我使用 Microsoft Graph Explorer 安排新会议时,我弄错了时间。

如果我打电话https://graph.microsoft.com/v1.0/me/mailboxsettings,我会得到我的时区:"timeZone": "W. Europe Standard Time".

如果我随后https://graph.microsoft.com/v1.0/me/events使用有效负载调用:

{
  "subject": "My event W. Europe Standard Time 3",
  "start": {
    "dateTime": "2019-04-02T16:01:03.353Z",
    "timeZone": "W. Europe Standard Time"
  },
  "end": {
    "dateTime": "2019-04-02T16:47:03.353Z",
    "timeZone": "W. Europe Standard Time"
  }
}

我按预期在 Outlook 中获得了已安排的会议,但时间不正确。我进入 Outlook 的时间18:1018:47.

4

1 回答 1

1

当您Z在时间的末尾加上 a 时,您是在说时间UTC。您需要从时间中删除时区信息,以便将其视为本地时间:

{
  "subject": "My event W. Europe Standard Time 3",
  "start": {
    "dateTime": "2019-04-02T16:01:00",
    "timeZone": "W. Europe Standard Time"
  },
  "end": {
    "dateTime": "2019-04-02T16:47:00",
    "timeZone": "W. Europe Standard Time"
  }
}
于 2019-04-01T13:41:13.520 回答