Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试运行节点 cron 作业的代码,但是当我指定特定时间时它不起作用。下面是代码。
var job = new cronJob({ cronTime: '00 01 16 * * 1-5', onTick: function() { console.log("hello"); }, start: true, timeZone: 'America/Los_Angeles' }); job.start();
它应该在每个工作日的下午 04:16:00 打印 hello。我想要这种行为
尝试将您的代码更改为:
var job = new cronJob({ cronTime: '00 16 16 * * 1-5', onTick: function() { console.log("hello"); }, start: true });