Formatting standards ·
Cron expressions: syntax, traps, and human-readable parsing
A cron string is a schedule grammar, not English. Five-field Vixie, six-field Quartz with seconds, and AWS with a year field all exist. DST transitions skip or repeat local hours. A deterministic explainer (cronstrue plus a parser) is safer than asking a model to “what does this cron do?”
Five fields versus six versus seven
minute hour dom month dow. Quartz inserts seconds. AWS scheduled events use cron(min hour dom month dow year) with ? in one of dom/dow. Copying a string between systems is a silent no-op or a flood.
Special characters
* / , - and dialect extras L W # ?. Step values (*/15) are not “every 15 minutes from epoch”; they are ticks on that field.
DST traps
Spring-forward skips a local hour; jobs at 02:30 may not run. Fall-back repeats. Store UTC internally if you can. The epoch article covers ISO offsets.
cron-parser and cronstrue in the tab
Deterministic libraries. Visualizers list next fires. No server clock besides the user’s Date, which is itself skew-prone.
Testing next-N occurrences
Iterate in a named IANA zone via Temporal when available, or a TZ library. Do not assume the laptop zone is production.
Frequently asked questions
Does 0 2 * * * run twice in autumn?
In time zones that repeat 02:00, it can run twice or be defined by the library. Never assume. Test next-N fire times in the target zone.
What does L and W mean?
Quartz: L last day of month, W nearest weekday, # nth weekday. They are invalid in classic Vixie.
Why not use an LLM to explain cron?
Models mix dialects. A parser either accepts the string or throws. That is the correct behavior.