我在玩谷歌日历编程界面:
https://developers.google.com/google-apps/calendar/v3/reference/events/insert#try-it
当我执行以下请求时,我得到以下响应:
要求:
POST https://www.googleapis.com/calendar/v3/calendars/o38t4tnqifv4kdanjkmegs2uqk%40group.calendar.google.com/events?key={YOUR_API_KEY}
Content-Type: application/json
Authorization: Bearer ya29.AHES6ZRv_qi4OhIhzN1C8YifUSO4mmXjufeKhaPmbyaRw3FVhXIgJQ
X-JavaScript-User-Agent: Google APIs Explorer
{
"end": {
"dateTime": "2013-04-07T20:30:00.01Z"
},
"start": {
"dateTime": "2013-04-07T19:30:00.01Z"
},
"description": "Just testing, 2003.",
"extendedProperties": {
"private": {
"foo": "bar"
}
},
"summary": "Hello World 1"
}
回复:
200 OK
- Show headers -
{
"kind": "calendar#event",
"etag": "\"78Bu1G8fWt0vPGZK2Ckfad3ZtNE/Z2NhbDAwMDAxMzY4NzE0MzM1NTc3MDAw\"",
"id": "e2pfv3men0e9r5mv4qp7hrsqs8",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=ZTJwZnYzbWVuMGU5cjVtdjRxcDdocnNxczggbzM4dDR0bnFpZnY0a2RhbmprbWVnczJ1cWtAZw",
"created": "2013-05-16T14:25:35.000Z",
"updated": "2013-05-16T14:25:35.577Z",
"summary": "Hello World 1",
"description": "Just testing, 2003.",
"creator": {
"email": "jdoe@gmail.com"
},
"organizer": {
"email": "o38t4tnqifv4kdanjkmegs2uqk@group.calendar.google.com",
"displayName": "ClientEventManager",
"self": true
},
"start": {
"dateTime": "2013-04-07T19:30:00Z"
},
"end": {
"dateTime": "2013-04-07T20:30:00Z"
},
"iCalUID": "e2pfv3men0e9r5mv4qp7hrsqs8@google.com",
"sequence": 0,
"extendedProperties": {
"private": {
"foo": "bar"
}
},
"reminders": {
"useDefault": true
}
}
我认为 DateTime 条目末尾的 .01Z 将指定 +01 时区(欧洲中部时间),但似乎谷歌服务器只是忽略它并将其转换为 GMT(一小时时差)而不添加 1小时,将事件显示为在指定时间之外一小时发生。特别注意:
要求:
{
"end": {
"dateTime": "2013-04-07T20:30:00.01Z"
},
"start": {
"dateTime": "2013-04-07T19:30:00.01Z"
},
回复:
"start": {
"dateTime": "2013-04-07T19:30:00Z"
},
"end": {
"dateTime": "2013-04-07T20:30:00Z"
},
Google 刚刚在 19:30 到 20:30 和 20:30 到 21:30 的情况下将 .01Z 变成了 .00Z。这是怎么回事?我的语法错了吗?如果是,那怎么办?
谢谢。