std/cron
On this page
Index
- type
CronErr- method
CronErr.display
- method
- type
Schedule- method
Schedule.next - method
Schedule.zone
- method
- fn
parse
Types
CronErr
struct CronErr {
msg: Str
}Why a spec did not parse; msg is robfig/cron’s text, for example
expected exactly 5 fields, found 3: [* * *].
CronErr.display
fn (e: CronErr) display() -> StrSchedule
struct Schedule {
_every: Int
_minute: Int
_hour: Int
_dom: Int
_month: Int
_dow: Int
_dom_star: Bool
_dow_star: Bool
_loc: time.Zone
}A parsed schedule: a value, never changes.
Schedule.next
fn (s: Schedule) next(after: Time) -> Time?The first fire time strictly after after (robfig’s Next, whole
seconds); None when none is found within 5 years. @every is
after plus the delay, rounded down to the second.
Schedule.zone
fn (s: Schedule) zone() -> time.ZoneThe zone the fields are read in.
Functions
parse
fn parse(spec: Str, zone: time.Zone = time.utc()) -> Schedule ! CronErrrobfig’s ParseStandard: five fields (minute 0-59, hour 0-23, day of month
1-31, month 1-12 or jan-dec, day of week 0-6 or sun-sat), each a comma
list of *, ?, a number or name, a range a-b and a step a-b/n,
*/n or a/n; or @yearly, @annually, @monthly, @weekly,
@daily, @midnight, @hourly, @every DURATION; optionally led by
TZ=Name or CRON_TZ=Name (the zone of the schedule; zone is the
default). Day of month and day of week both restricted: either matches;
either starred: both must.