Google Calendar API timeZone属性

时间:2018-05-30 06:46:38

标签: google-api google-calendar-api

我有一个我正在使用的时区列表,我想将它们传递给谷歌日历,而不是在运行时将它们转换为偏移量。我已经在为这些时区使用匹配表了,我在" dateTime"的末尾添加了时区偏移量。每个时区的属性。

CET
Europe/Prague
US/Eastern
PST
EST
US/Pacific
CTT
Asia/Tokyo
CST
Asia/Taipei
Europe/London
Europe/Amsterdam
Europe/Belgrade
America/Montreal
Australia/Melbourne
Europe/Oslo
Europe/Berlin
Europe/Zurich
Asia/Novosibirsk
Asia/Hong_Kong
Asia/Shanghai
ROK
Asia/Jerusalem
America/Fortaleza
IST
America/Belem
America/New_York

问题是,这个列表只会继续增长,而我要问的是谷歌日历是否有办法将这些时区名称解释为UTC的偏移量。我有一个我使用的JSON示例:

{
  "Event" : {
    "description" : "Out of office. Reason: Doctor_visit. Status: APPROVED.",
    "end" : {
      "dateTime" : "2016-11-16T09:00:00+0200"
      "timeZone" : "Europe/Prague"
    },
    "start" : {
      "dateTime" : "2016-11-16T12:00:00+0200"
       "timeZone" : "Europe/Prague"
    },
    "summary" : "Out of office"
  },
  "parameters" : {
    "calendarId" : "xxx@group.calendar.google.com"
  }
}

而不是" + 0200"抵消,我问我是否可以通过" timeZone" :"欧洲/布拉格"以某种方式解释。我试过放一个" + 0000"并将时区名称传递给" timeZone"属性,或传入" + 0000"和" timeZone"属性解释为" UTC + 2:00",但它似乎对我有用的唯一方法是,如果我在运行时解释时区并在" dateTime&#34结束时添加偏移量;上面格式的属性。

我正在使用Dell Boomi与日历API进行通信。非常感谢任何帮助:)

1 个答案:

答案 0 :(得分:0)

Google日历时区如果您想要添加events.insert

文档中所述的事件,则无法更改这些时区
  

时间,作为组合日期时间值(根据RFC3339格式化)。除非在timeZone中明确指定时区,否则需要时区偏移。

插入时必须将其转换为正确的格式。你可能想考虑将其添加为功能请求issue forum