node-cron
node-cron copied to clipboard
Cron expression at 12 am Asia/Kolkata doesn't trigger cronJob expression "0 0 0 * * *"
Description
When I deployed to azure servers and running on 3rd Feb 2022 if I set 12 am cron expression "0 0 0 * * *" should trigger on 4th Feb 2022 doesn't triggers.
masterCronJob = new CronJob("0 0 0 * * *", async()=>{
console.log("starting setting users subscription validity at 12 am IST",moment().format());
await checkUserValidity();
}, null, true, 'Asia/Kolkata');
While if change or use any other expression like "0 36 0 * * *" triggers right way at the right time is being set with the timezone.
What could be the issue?
Screenshots
Doesn't trigger cronJob at 12am

Additional information
No response
Check out github.com/hexagon/croner for a great alternative, pay special attention to the "Why another JavaScript cron implementation?"
Check out github.com/hexagon/croner for a great alternative, pay special attention to the "Why another JavaScript cron implementation?"
Does croner allows to add timezone apart from Europe ? Also can we use Momentjs values ?
Yes, croner supports all time zones.
And if you refer to using a Date as cron pattern to run a one-off job, it is supported. Croner use ISO 8601 time strings for all string input, which can be generated by moment using dateObj.format().