如何以编程方式获取下一个预定的触发时间? [英] How to get next scheduled trigger time programmatically?

查看:54
本文介绍了如何以编程方式获取下一个预定的触发时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我制作了一个新的可安装触发器,该触发器会以编程方式每两天为我的电子表格触发一次.然后,当我返回电子表格时,是否可以获取下一次它将触发功能的信息?甚至触发频率是多少?我所看到的就是我可以得到它的类型,它触发的功能,唯一的ID等.

I make a new installable trigger that fires each 2 days for my spreadsheet programmatically. Then when I return to the spreadsheet, can I get the next time it will trigger a function? Or even how often it triggers? All I see is that I can get it's type, function it triggers, unique ID and so on.

谢谢

推荐答案

没有任何方法可以检查触发器何时下一次运行或什至上一次运行.但是,您可以做的是记录触发器作为触发器功能的一部分运行的时间.然后,根据您的应用程序,可以将值存储在电子表格中(或者最好使用属性服务),然后将此值与当前日期/时间进行比较,以生成下一个触发条件为..."

There is no method for checking when a trigger will next run or even when it last ran. What you can do however is record when a trigger runs as part of your trigger function. Depending on your application, you can then store the value in a spreadsheet (or better yet use Properties service) and then compare this value to the current date/time to generate "Next trigger at..."

这实际上实现了相同的功能,而不必调用触发方法.

This essentially accomplishes the same functionality without having to call a trigger method.

这篇关于如何以编程方式获取下一个预定的触发时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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