gpt4 book ai didi

rest - 谷歌日历 API : TimeZone not taken into account by google server?

转载 作者:行者123 更新时间:2023-12-04 16:11:01 24 4
gpt4 key购买 nike

我正在玩谷歌日历编程界面:

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 刚刚将 .01Z 变成了 .00Z,没有 channight 19:30 到 20:30
和 20:30 到 21:30。这是怎么回事?我的语法错了吗?如果是,那么如何?

谢谢。

最佳答案

API 接受“timeZone”参数。您可能想尝试传递一个时区值,如“GMT+1:00”或“UTC+1:00”。

我们之前在我们的团队中也遇到过类似的问题,我们只是通过调整值(value)观来把事情做好。

关于rest - 谷歌日历 API : TimeZone not taken into account by google server?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16590289/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com