以编程方式更改Google Apps脚本的时区 [英] Programmatically change a Google apps script's timezone

查看:74
本文介绍了以编程方式更改Google Apps脚本的时区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在努力尝试正确设置。



是否可以通过编程方式更改该属性?

解决方案

否。项目时区不能用代码更改。您可以使用代码获取脚本时区Session.getScriptTimeZone(),但不能使用代码进行设置。无论如何,您都不应该在代码中更改脚本时区。我假设您有不同时区的用户?如果该脚本在不同时区有多个用户,那么我将脚本中的时区设置为+ GMT 00:00 no夏令时。并留在那里。


I've been having a very hard time trying to properly set up the timezones of calendar event dates because the Javascript's Date object is taking the project's timezone:

.

Is there a way to programmatically change that property?

解决方案

No. The project time zone can not be changed with code. You can get the script time zone Session.getScriptTimeZone() with code, but you can not set it with code. You shouldn't be changing the script time zone in code anyway. I'm assuming that you have users who are in different time zones? If there are multiple users of the script in different time zones, then I set the Time Zone in the script to +GMT 00:00 no daylight savings. And leave it at that.

这篇关于以编程方式更改Google Apps脚本的时区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆