chronos-parser-rs
A Rust crate for CROND parser.
Installation
Add the following configuration to Cargo.toml
.
[]
= "0.1.XXX"
Usage
// Create a new cron schedule
let cron_schedule = new.unwrap;
// Create a DateTime object representing January 1, 2021, 1:01:00 AM (UTC)
let dt: DateTime = Utc.with_ymd_and_hms.unwrap;
// Return an iterator that calculates the scheduled execution times after this date and time
let iterator = cron_schedule.upcoming;
// Print the next 5 scheduled execution times
for next_trigger in iterator.take
2021-01-01T02:00:00Z
2021-01-01T02:30:00Z
2021-01-01T04:00:00Z
2021-01-01T04:30:00Z
2021-01-01T06:00:00Z