TimeRule

A time rule of a schedule, in cron syntax or in the `every(...)` syntax (clockwork §CW-D-3, §CW-D-4).

In the namespace clockwork. Declared in src/libs/libclockwork/clockwork/TimeRule.hpp.

Detailed description

parse() is the one parser. The evaluator works on instants in UTC, and finds local times in the zone that the caller gives, never in the default zone of the process.

Cron: five fields, minute, hour, day of month, month and day of the week, each with `*`, numbers, ranges, lists and steps. Months and days take their English three-letter names. Day 0 and day 7 are Sunday. The day rule is Vixie cron's: when the day of month and the day of the week both start with something other than `*`, a day matches when either one matches. Otherwise both must match, and a field that is `*` matches every day. The short forms `@hourly`, `@daily` (`@midnight`), `@weekly`, `@monthly` and `@yearly` (`@annually`) stand for their five fields.

Every: `every(N).unit`, with unit seconds, minutes, hours, days or weeks (the singular too), then optionally `.at(HH:MM)` for days and weeks, and `.jitter(S)`. Seconds, minutes and hours count elapsed time from the anchor, which is the creation of the schedule. Days and weeks fire at a local time: the time of `.at()`, or the minute of the anchor without it. The first firing is the first such time after the anchor, and weeks keep the weekday of that first firing.

DST follows Vixie cron. A local time that the change to summer time skips fires once, at the first instant after the gap. A local time that the change to winter time repeats fires once, at its first occurrence. Elapsed rules count in UTC, so a DST change does not move them.

Each evaluator method takes the anchor. An invalid anchor counts as 1970-01-01T00:00:00Z. A cron rule ignores it.

In this section