Expand description
§philiprehberger-cron-parser
Cron expression parsing, scheduling, and human-readable descriptions. Zero external dependencies — uses only the standard library.
§Quick Start
use philiprehberger_cron_parser::{CronExpr, DateTime};
let expr = CronExpr::parse("*/15 * * * *").unwrap();
let now = DateTime { year: 2026, month: 3, day: 15, hour: 10, minute: 3, second: 0 };
let next = expr.next_from(&now).unwrap();
assert_eq!(next, DateTime { year: 2026, month: 3, day: 15, hour: 10, minute: 15, second: 0 });
// Human-readable description
assert_eq!(expr.describe(), "Every 15 minutes");§Supported Syntax
Standard 5-field cron: minute hour day-of-month month day-of-week
Each field supports: single values (5), ranges (1-5), steps (*/15, 1-5/2),
lists (1,3,5), and wildcards (*).
Aliases: @hourly, @daily, @midnight, @weekly, @monthly, @yearly, @annually
Structs§
Enums§
- Parse
Error - Errors that can occur when parsing a cron expression.
Functions§
- day_
of_ week - Returns the day of the week for a given date. 0 = Sunday, 1 = Monday, …, 6 = Saturday.
- days_
in_ month - Returns the number of days in the given month (1-12) for the given year.
- is_
leap_ year - Returns
trueifyearis a leap year.