Reputation: 1160
I ran the following function in Google Apps Script:
function createTrigger() {
ScriptApp.newTrigger('myFunction')
.timeBased()
.nearMinute(16)
.everyHours(1)
.create();
}
and a trigger was created which runs every hour at minute 52. According to the documentation, .nearMinute(16)
should create a trigger that runs between minute 1 and minute 31. Am I doing something wrong?
Upvotes: 0
Views: 687
Reputation: 26836
As for the creation time, in your case the trigger gets created directly when you run the function createTrigger()
.
However, for a clock trigger the creation time is not important and does not affect at what time the trigger will run.
Your function builds a trigger that will run each hour near minute 16 - no matter at what time the trigger is created.
Upvotes: 0