如何使用谷歌应用脚本设置当前时间?我很难找到时间文档 .
我能用毫秒来获得时间 .
(new Date()).getTime()
我_238425_m使用日期documentation . 我尝试过使用javascript中的 toLocaleTimeString()
但它没有在应用脚本中定义
如何使用谷歌应用脚本设置当前时间?我很难找到时间文档 .
我能用毫秒来获得时间 .
(new Date()).getTime()
我_238425_m使用日期documentation . 我尝试过使用javascript中的 toLocaleTimeString()
但它没有在应用脚本中定义
1 回答
要格式化日期,您需要的是Utilities.formatDate()函数,在此处记录:https://developers.google.com/apps-script/reference/utilities/utilities#formatDate(Date,String,String)
用于获得时间的用法是:
用适当的值替换您的日期和您的TIMEZONE .