【发布时间】:2014-08-08 16:24:46
【问题描述】:
我想create a Calendar event 使用与日历相同的timezone。
我已经在单独的变量中将年、月和日作为数字。如何在特定时区使用这些值构造 Date 对象?
var day = 31;
var month = 11; // Month is zero-based
var year = 2014;
var timezone = calendar.getTimeZone();
// How to add the timezone here?
var date = new Date(year, month, day, 12, 0, 0);
基本上,我问这个是因为documentation:
如果未指定时区,则时间值将在脚本时区的上下文中进行解释,该时区可能与日历的时区不同。
因此我想知道如何正确指定时区。
相关博文(虽然没有回答我的问题):
【问题讨论】:
标签: date google-apps-script timezone