如何在 AppMaker 环境中更改时区?
How do I change timezone in AppMaker Environment?
我在 AppMaker 应用程序中得到的时间不正确,所以我添加了这个 console.log 语句以查看它是什么 returning。
function getTodaysDate(){
console.log('Time Zone is ',Session.getScriptTimeZone());
return Utilities.formatDate(new Date(),Session.getScriptTimeZone(),"E MMM d, yyyy HH:mm");
}
这是return:
Sat Dec 09 09:54:38 GMT-700 2017 Time Zone is America/Los_Angeles
然而,我住在另一个时区。事实上,您可以在 控制台日志响应中 查看我的时区 。
The problem is that I don't know where to change this in App Maker and the instructions that pop with code completion seem to refer to the old script editor and not the App Maker Editor.
So for now I'm not using Session.getScriptTimeZone() but simply hardwiring it to "GMT-7".
instructions that pop with code completion seem to refer to the old script editor and not the App Maker Editor
完全没问题,因为应用制作工具正在生成 Apps 脚本应用。
File -> Project properties
您无法访问此配置,因为 Apps 脚本项目(应用制作工具部署)是由应用制作工具应用 hidden/encapsulated 提供的,而应用制作工具目前不提供配置这些属性的方法。 ..
我们有a video showing how you can solve this with the AMU Library
我在 AppMaker 应用程序中得到的时间不正确,所以我添加了这个 console.log 语句以查看它是什么 returning。
function getTodaysDate(){
console.log('Time Zone is ',Session.getScriptTimeZone());
return Utilities.formatDate(new Date(),Session.getScriptTimeZone(),"E MMM d, yyyy HH:mm");
}
这是return:
Sat Dec 09 09:54:38 GMT-700 2017 Time Zone is America/Los_Angeles
然而,我住在另一个时区。事实上,您可以在 控制台日志响应中 查看我的时区 。
The problem is that I don't know where to change this in App Maker and the instructions that pop with code completion seem to refer to the old script editor and not the App Maker Editor.
So for now I'm not using Session.getScriptTimeZone() but simply hardwiring it to "GMT-7".
instructions that pop with code completion seem to refer to the old script editor and not the App Maker Editor
完全没问题,因为应用制作工具正在生成 Apps 脚本应用。
File -> Project properties
您无法访问此配置,因为 Apps 脚本项目(应用制作工具部署)是由应用制作工具应用 hidden/encapsulated 提供的,而应用制作工具目前不提供配置这些属性的方法。 ..
我们有a video showing how you can solve this with the AMU Library