如何在Google Apps脚本中使用.setTimeZone(String)

问题描述 投票:1回答:2

我已经制作了一个脚本,使用Google Apps脚本将所有学校课程转移到日历,但我遇到了DST问题。我发现

.setTimeZone(string)

在谷歌文档中,但无法使其工作。有帮助吗?

function makeCalendar(name, begin, end, calendar, recurrence) {
    var eventSeries = CalendarApp.getCalendarById(calendar).createEventSeries(
        name,
        begin,
        end,
        recurrence.setTimeZone("Europe/Belgrade")
    );  
}

这应该已经改变了事件的时区但是它停留在UTC,我可以手动编辑,但不能通过代码更改它

google-apps-script timezone google-calendar-api dst
2个回答
© www.soinside.com 2019 - 2024. All rights reserved.