crontime

Crates.iocrontime
lib.rscrontime
version0.4.0
created_at2024-01-04 12:13:03.84007+00
updated_at2024-12-26 10:44:36.155399+00
descriptioncron expression -> time iterator
homepagehttps://github.com/lsunsi/crontime
repositoryhttps://github.com/lsunsi/crontime
max_upload_size
id1088468
size58,549
Lucas Sunsi Abreu (lsunsi)

documentation

README

It's cron time! ⏲️

badge

Description

This library is intended to work as a cron expression parser. For now it yields an iterator of upcoming datetimes that follow the parsed expression, simple as that.

This library is in development. It does not implement the whole syntax yet.

Usage

let now = datetime!(1917-11-07 00:00:00 UTC);
let ct = crontime::build(now, "0 1 * * * *").unwrap();

for dt in ct.take(3) {
    println!("{dt}");
}

// 1917-11-07 0:01:00.0 +00:00:00
// 1917-11-07 1:01:00.0 +00:00:00
// 1917-11-07 2:01:00.0 +00:00:00

Thanks

Commit count: 27

cargo fmt