javascript - Triggers on specific time in google sheets
问题描述
I want to execute a code at 7.00 PM daily in Google Sheets. I created trigger but it is executing at 7.58 PM daily.
function Work_Flow_Trigger() {
ScriptApp.newTrigger("Work_Flow")
.timeBased()
.atHour(19)
.nearMinute(00)
.everyDays(1)
.create();
}
解决方案
nearMinute() is not exact, it's plus/minus 15 minutes (please refer to API documentation here.
If you need to be more precise you have to use everyMinutes(1) and add a code to run target function once you reach desired point in time.
推荐阅读
- entity-framework-core - 包含子查询的 Linq 在 EF Core 上失败
- entity-framework - 更新期间的实体框架错误:必填字段
- git - 如果设置了深度标志,Git 克隆或子模块更新找不到私钥文件
- ruby-on-rails - 使用 Kaminari 对迭代进行分页时遇到问题
- c++ - 如何在 VSCode 中构建和编译 C++?
- javascript - JavaScript 返回以及如何使用它来捕获错误
- swift - 将 SQLite 查询结果附加到现有模型
- shell - 无法在 sqlloader 中设置默认值
- c# - 使用 JObject.FromObject 序列化普通值和对象
- python - Pandas Groupby:如何获得不同的列值