我對使用Outlook API特別與Calendar API有關的問題。日曆中的Outlook API時間差異
我用UTC格式發送日期,當它們添加到日曆中時,我與發送日期有所不同。
我在法國,所以原始日期是UTC + 2。我轉換成UTC,讓我這個配置要求:
var options = {
url: "https://outlook.office.com/api/v2.0/me/calendars/" + workspace.calendarId + "/events?$Select=Id",
method: "POST",
headers: {
"authorization": "Bearer " + host.outlookCalAccessToken,
"accept" : "application/json",
"ContentType" : "application/json"
},
json:{
"Subject" : event.summary,
"Body" : {
"ContentType" : "Text",
"Content" : event.description
},
"Start" : {
"DateTime":start,
"TimeZone" : "OriginStartTimeZone"
},
"End" : {
"DateTime":end,
"TimeZone" : "OriginStartTimeZone"
},
"Attendees" : [
{
"EmailAddress" : {
"Name" : nomad.firstname,
"Address" : nomad.email
},
"Type" : "Required"
}
]
},
"Content-Type" : "application/json"
};
我有同樣的問題,如果時區爲「OriginStartTimeZone」或「UTC」。
例如,我的本地日期是2017-10-19T17:00:00.000
它轉換爲UTC 2017-10-19T15:00:00.000Z
而在日曆事件日期是2017-10-19T08:00:00.000
有什麼我錯過了這個API?
謝謝!