croner
croner copied to clipboard
Croner completely broken on DST change when specifying a time zone
Describe the bug Unlike #284, Croner is evaluating every 1 millisecond.
To Reproduce Run the following. That's all:
import { Cron } from "croner";
new Cron("* * * * *", { timezone: "America/Los_Angeles" }, () => {
console.log("Cron job executed every minute");
});
You will be utterly spammed with logs. Removing the time zone however will work correctly (although that may be because I am in a time zone where it did not change today/UTC on server).
I also received this:
2025-11-01T10:27:00Z [info](node:664) TimeoutNegativeWarning: -30517337 is a negative number.
2025-11-01T10:27:00Z [info]Timeout duration was set to 1.
2025-11-01T10:27:00Z [info](Use `node --trace-warnings ...` to show where the warning was created)
Expected behavior Logs every minute.
System:
- OS: macOS
- Runtime Node.js 22, Node.js 24
- Croner Version 9.1.0
Additional context Has been working fine up until now. I assume DST broke it.
I believe I can no longer reproduce. I'm guessing since the "hour" has passed, it has become fine now.
Fixed in prereleases 9.1.1-dev.0 and 10.0.0-dev.4