4 releases (breaking)

new 0.4.0 Dec 26, 2024
0.3.0 Dec 21, 2024
0.2.0 Dec 16, 2024
0.1.0 Jan 4, 2024

#1811 in Parser implementations

Download history 1/week @ 2024-10-07 5/week @ 2024-10-14 2/week @ 2024-11-04 246/week @ 2024-12-16 143/week @ 2024-12-23

389 downloads per month

GPL-3.0-only

18KB
178 lines

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

Dependencies

~2.5MB
~55K SLoC