问题描述
我有一个正在使用的时区列表,我想将它们传递给Google日历,而不是在运行时将其转换为偏移量.我已经在这些时区使用了匹配表,并且在每个时区的"dateTime"属性的末尾添加了时区偏移量.
I have a list of time zones that I am using, and I want to pass them to google calendar rather than converting them to offsets at runtime. I am already using a match table for these time zones, and I am adding the timezone offset at the end of the "dateTime" attribute for each of these timezones.
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
问题是,此列表只会继续增长,我要问的是Google日历是否可以将这些时区名称解释为UTC的偏移量.我有一个使用的JSON示例:
The problem is, this list will only continue to grow, and what I am asking is if there is a way for google calendar to interpret these timezone names as offsets to UTC. I have a sample of the JSON I use:
{
"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" : "[email protected]"
}
}
我问是否可以传递"timeZone":"Europe/Prague"以代替"+0200"偏移量.我尝试将偏移量设置为"+0000",并将时区名称传递给"timeZone"属性,或者传递"+0000"和一个解释为"UTC + 2:00"的"timeZone"属性,但是唯一对我来说似乎有效的方式是,如果我在运行时解释时区,并以上述格式在"dateTime"属性的末尾添加一个偏移量.
Instead of the "+0200" offset, I am asking if I can pass in "timeZone" : "Europe/Prague" to be interpreted somehow. I have tried putting an offset of "+0000" and passing in the timezone name to the "timeZone" attribute, or passing in "+0000" and a "timeZone" attribute interpreted as "UTC+2:00", but the only way it seems to work for me is if I interpret the timezone at runtime and add an offset at the end of the "dateTime" attribute in the format above.
我正在使用Dell Boomi与日历API通信.任何帮助,我们将不胜感激:)
I am using Dell Boomi to communicate with the calendar API. Any help is greatly appreciated :)
推荐答案
Google日历时区是内部的,如果您要添加事件,则无法更改它们,如 events.insert
Google calendars timezones are internal you cant change them if you want to add an event as stated in the documentation for events.insert
插入时必须将其转换为正确的格式.您可能想考虑将此添加为功能请求问题论坛
You must convert it to the correct format when you insert it. YOu may want to consider adding this as a feature request issue forum
这篇关于Google Calendar API timeZone属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!