首先,我可以在哪里找到已接受的timeZone
值列表?
为简单起见,我通过google api "try it now" form执行此操作
我的要求:
{
"timeMin":"2014-01-20T13:00:00+01:00",
"timeMax":"2014-01-20T18:00:00+01:00",
"items":[
{
"id":"XXXXXXX@gmail.com"
},
{
}
],
"timeZone":"Europe/Warsaw"
}
返回错误:
{
"kind":"calendar#freeBusy",
"timeMin":"2014-01-20T12:00:00.000Z",
"timeMax":"2014-01-20T17:00:00.000Z",
"calendars":{
"XXXXXXX@gmail.com":{
"busy":[
{
"start":"2014-01-20T15:30:00+01:00",
"end":"2014-01-20T17:00:00+01:00"
}
]
},
"":{
"errors":[
{
"domain":"global",
"reason":"notFound"
}
],
"busy":[
]
}
}
}
如果我删除timeZone
属性,它可以工作但返回UTC时间。我在timeZone名字上有拼写错误吗?或者它是一个google api bug?
答案 0 :(得分:3)
要查看时区,请参阅此页:Time Zones by Country。 它看起来不像错误。您的请求包含空对象。试试这个请求正文:
{
"timeMin": "2014-01-20T13:00:00+01:00",
"timeMax": "2014-01-20T18:00:00+01:00",
"timeZone": "Europe/Warsaw",
"items":
[
{
"id": "XXXXXXX@gmail.com"
}
]
}
时区Europe/Warsaw
是时区的有效名称。