sigildocs

(sigil later)

(sigil later) - Cron expression parsing and time matching.

Parses standard 5-field cron expressions into schedule structs and provides pure functions for testing timestamps against them.

(let ((sched (parse-cron-string "*/5 * * * *")))
  (later-matches? sched (current-second))
  (later-next sched (current-second)))

Exports

Construct a later-schedule struct.

Test if a value is a later-schedule struct.

Get the minutes field of a later-schedule struct.

Get the hours field of a later-schedule struct.

Get the days-of-month field of a later-schedule struct.

Get the months field of a later-schedule struct.

Get the days-of-week field of a later-schedule struct.

Parse a standard 5-field cron string into a schedule.

Fields: minute hour day-of-month month day-of-week

Supports: , numbers, ranges (1-5), lists (1,3,5), steps (/5, 1-10/2), named days (MON-FRI), named months (JAN-DEC).

Test whether a Unix timestamp matches a cron schedule.

later-nextprocedure

Find the next timestamp after ts that matches the schedule.

Searches minute-by-minute, jumping forward when higher-order fields don't match. Returns a Unix timestamp or #f if no match is found within 366 days.