Cron Schedule for Cloudflare Workers
Code & Engineering
Turns a schedule described in words into cron expressions for Cloudflare Workers Cron Triggers, answered as JSON with the crons and a note. Knows where Cloudflare differs from classic cron, measured on a live Worker - day-of-week 1 is Sunday, so 1-5 runs Sunday to Thursday and 7 is Saturday, while 0 and ? are rejected; times are UTC only. Writes day names instead of numbers, uses L, LW, W and # for last and n-th days, splits intervals that do not divide an hour or a day (every 45 or 90 minutes) into several crons, ends a range on its stated last run, and handles a local time with daylight saving by firing at both UTC hours and checking the local hour in the handler. Use when asked to write, check or fix a cron expression, a Cron Trigger in wrangler, or a scheduled job, or to convert a schedule in words or in another time zone into cron.