NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io
crates.io, #3132 most downloaded on crates.io
Fully-featured, lightweight, and efficient Rust library designed for parsing and evaluating cron patterns
Latest stable
4.0.3
Last release 18 days ago
04 Nov 2026
Release timing varies
gaps range from 2 weeks to 10 months
Nearly every release is documented
notes for 29 of 31 stable releases
2 versions withdrawn
withdrawn after publishing
3 years old
33 releases · first in 2023
Drag across the ruler to compare, or tap a release to open it.
Fix 7L (last Sunday) never matching by @youdie006 in #63
Full Changelog: v4.0.2...v4.0.3
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Full Changelog: https://github.com/Hexagon/croner-rust/compare/v4.0.2...v4.0.3
0 0 * * * job in Europe/London running at both 00:00 and 02:00 on the transition day). Only a scheduled wall clock time that falls inside the gap is moved past it, as documented. Regression since 3.0.0 (#67).*/n (and /n with sloppy_ranges) being rejected in the day-of-week field when alternative_weekdays is enabled.describe_lang now routes every phrase through Language: "hour N", "X past Y", "every N months" and "every N years" were hard-coded English. Added Language methods with English defaults (every_past_phrase, past_hour_phrase, every_x_months, every_x_years), so existing implementations still compile, and translated them for Swedish.Language::time_of_day() so a language can format times of day, e.g. with a 12-hour clock.7L and 7#L (last Sunday using 7) never matching in the day-of-week field.Expose parsed field values and day-matching flags by @gilesw in #59
Full Changelog: https://github.com/Hexagon/croner-rust/compare/v4.0.1...v4.0.2
CronPattern and CronComponent, so the parsed fields of Cron::pattern can be named outside the crate.CronComponent::values() and CronComponent::has_modifiers() to read a field's plain values and whether it uses L, W or #.CronPattern::is_dom_wildcard(), is_dow_wildcard() and matches_dom_and_dow() to read how day-of-month and day-of-week combine.Fix @Weekly with Quartz weekdays by @bensynapse in #57
Full Changelog: v4.0.0...v4.0.1
Full Changelog: https://github.com/Hexagon/croner-rust/compare/v4.0.0...v4.0.1
Breaking Changes & Migration Guide
CronDateTime Trait & Jiff Support: Introduced a backend-agnostic CronDateTime trait by @ion-elgreco (#48), adding an optional, high-performance jiff datetime backend alongside chrono (#49). The chrono backend is now placed behind an optional feature flag (enabled by default).sloppy_ranges mode ([#39](#39)).Eq and Ord implementations for Cron by @CardboardTurkey ([#43](#43)).chrono by @paolobarbolini ([#42](#42)) and isolated it behind a feature flag.simple_demo to use the Jiff backend ([#52](#52)).Version 4.0 introduces architectural upgrades that may require code adjustments. For complete details, consult the official MIGRATION.md guide. Key breaking changes include:
chrono is now an optional feature flag (enabled by default). If your project compiles with default-features = false, you must explicitly add "chrono" or "jiff" to your Cargo.toml.5/5 * * * *) is now rejected by default and requires explicit ranges like 5-59/5 * * * *. You can restore the old lenient behavior by building your parser with .sloppy_ranges(true).CronDateTime trait instead of chrono::TimeZone. Return types match the input type. When type inference is ambiguous (e.g., with multiple backends enabled), a turbofish annotation may be needed:let next = cron
.find_next_occurrence::<chrono::DateTime<chrono::Utc>>(&chrono::Utc::now(), false)
.unwrap();find_occurrence method has been removed from the public API; use find_next_occurrence instead.croner::from_naive function is deprecated; use chrono::TimeZone::from_local_datetime directly.CronIterator<Tz> has been renamed to CronIterator<T>.Full Changelog: v3.0.1...v4.0.0
CronDateTime trait and shared civil-time abstractions.jiff backend, simple_demo_jiff, and backend parity coverage.LW, +, and strict step-syntax validation.chrono backend optional while keeping it enabled by default.sloppy_ranges(true) available for backward compatibility.This is a patch release that fixes a grammatical issue in cron pattern descriptions and updates several dependencies to their latest versions.
This is a patch release that fixes a grammatical issue in cron pattern descriptions and updates several dependencies to their latest versions.
Fixed grammatical errors in human-readable descriptions for patterns with wildcard minutes/seconds and specific hours.
Before:
Cron::from_str("* 0 * * *").unwrap().describe()
// Output: "At of hour 0." ❌After:
Cron::from_str("* 0 * * *").unwrap().describe()
// Output: "Every minute past hour 0." ✅Additional patterns fixed:
* 5 * * * → "Every minute past hour 5."* 0,12 * * * → "Every minute past hour 0 and 12."* 0-5 * * * → "Every minute past hour 0-5."* */2 * * * → "Every minute past of every 2 hours."* * 0 * * * → "Every second past hour 0." (6-field patterns)* * 5 * * * → "Every second past hour 5." (6-field patterns)All dependencies have been updated to their latest compatible versions:
All updates maintain full backwards compatibility.
Thanks to @JosiahParry for reporting issue #35!
Full Changelog: v3.0.0...v3.0.1
* 0 * * * and * * 0 * * *.Version 3.0 is a significant release, introducing powerful new features, major API enhancements for improved safety and flexibility, and important bug
Version 3.0 is a significant release, introducing powerful new features, major API enhancements for improved safety and flexibility, and important bug fixes.
0 30 23 * * FRI 2025-2026 (At 23:30, on Friday, in year 2025 and 2026). This is breaking because 7-part patterns would throw an error in previous versions, but is successfully parsed with the default configuration from 3.0.0. It's possible to emulate the previous behavior by disallowing years through configuration.find_previous_occurrence() method and iter_before() iterator allow for iterating backwards in time from a given point.CronParser has been enhanced with a builder pattern (CronParser::builder()) for a more type-safe and explicit configuration. This allows you to precisely control:
Optional, Required, Disallowed).Optional, Required, Disallowed).dom_and_dow)..describe() method. This feature is also extensible with internationalization support, demonstrated with an initial Swedish translation.Cron and CronPattern now implement common traits including Eq, PartialEq, Ord, PartialOrd, and Hash. This allows Cron instances to be reliably compared, sorted, and used in hash-based collections like HashMap.L, #, and W. Validation logic has been refined to ensure that the ? wildcard is only permitted in the day-of-month and day-of-week fields, improving pattern integrity.W): The W modifier is now correctly constrained within the given month. The search for the closest weekday will no longer incorrectly cross into a previous or subsequent month.From this version on, the initialization of Cron instances has been updated to use a flexible builder pattern, which is more idiomatic to Rust, and provides greater control and type safety.
Previous Method (Before v3.0)
Previously, Cron was typically initialized directly from a string, which used a default parser configuration:
// Parse cron expression
let cron_all = Cron::new("18 * * * 5")
// <options>
.parse()
.expect("Couldn't parse cron string");
New Recommended Method (v3.0 and later)
For v3.0 and later, there are two primary ways to construct a Cron object, depending on your needs.
Directly, using default settings: For simple cases that do not require special configuration, the Cron::from_str() method is the most convenient option.
use std::str::FromStr as _;
use croner::Cron;
let cron = Cron::from_str("*/10 * * * *").unwrap();
With a configured parser: For custom behavior, the new builder pattern is the recommended approach.
use croner::parser::{CronParser, Seconds};
use croner::Cron;
let parser = CronParser::builder()
.seconds(Seconds::Disallowed) // Example: Only allow 5-part patterns
.dom_and_dow(true) // Example: require both day-of-month and day-of-week to match (Quartz Mode)
.build();
let cron = parser.parse("0 0 1 * MON").expect("Invalid cron pattern");
Full Changelog: https://github.com/Hexagon/croner-rust/compare/v2.2.0...v3.0.0
Add optional support for serde by @jakewmeyer in https://github.com/Hexagon/croner-rust/pull/15
Full Changelog: https://github.com/Hexagon/croner-rust/compare/v2.1.0...v2.2.0
impl Display for Cron and as_str to get the original pattern by @veeshi in https://github.com/Hexagon/croner-rust/pull/7
Full Changelog: https://github.com/Hexagon/croner-rust/compare/v2.0.8...v2.1.0
Fixes #13, error when using '7' as Sunday in "Nth occurrence of weekday"
Full Changelog: https://github.com/Hexagon/croner-rust/compare/v2.0.7...v2.0.8
Fixes #12, panic when passing 0 as weekday when using .with_alernative_weekdays()
Full Changelog: https://github.com/Hexagon/croner-rust/compare/v2.0.6...v2.0.7
Make cron iterator public by @veeshi in https://github.com/Hexagon/croner-rust/pull/8
Full Changelog: https://github.com/Hexagon/croner-rust/compare/v2.0.5...v2.0.6
feat: added debug derive impl to Cron struct by @willmalcs in https://github.com/Hexagon/croner-rust/pull/5
Full Changelog: https://github.com/Hexagon/croner-rust/compare/v2.0.4...v2.0.5
This release contains a minor update, exposing the errors module to the public interface.
This release contains a minor update, exposing the errors module to the public interface.
Full Changelog: https://github.com/Hexagon/croner-rust/compare/v2.0.3...v2.0.4
Maintenance release focusing mainly on documentation updates and additional test cases.
Maintenance release focusing mainly on documentation updates and additional test cases.
Full Changelog: https://github.com/Hexagon/croner-rust/compare/v2.0.2...v2.0.3
Added support for Quartz-style last occurrence of weekday '5L'
Full Changelog: https://github.com/Hexagon/croner-rust/compare/v2.0.1...v2.0.2
Fixed an issue related to impossible patterns. To prevent infinite loops, the search for future occurrences is now limited to the year 5000. Attempts
CronError::TimeSearchLimitExceeded.Full Changelog: https://github.com/Hexagon/croner-rust/compare/v2.0.0...v2.0.1
Croner 2.0 introduces key changes, notably the default disabling of second granularity and added opt-in support for Quartz-style handling of weekday n
Croner 2.0 introduces key changes, notably the default disabling of second granularity and added opt-in support for Quartz-style handling of weekday numbers.
.with_seconds_required and .with_seconds_optional: Now you can specify if second-level precision in your cron patterns should be disabled (default), optional or required..with_alternative_weekdays: This feature allows the configuration of alternative weekday handling (e.g. Quartz compatibility).CronPattern.Full Changelog: https://github.com/Hexagon/croner-rust/compare/v1.0.5...v2.0.0
Improves internal documentation
Full Changelog: https://github.com/Hexagon/croner-rust/compare/v1.0.4...v1.0.5
Adds .with_dom_and_dow(bool): New method which allow you to modify how the day of the month and day of the week values are combined.
.with_dom_and_dow(bool): New method which allow you to modify how the day of the month and day of the week values are combined.Full Changelog: https://github.com/Hexagon/croner-rust/compare/v1.0.3...v1.0.4
Fixes problem with matching closest weekday
Full Changelog: https://github.com/Hexagon/croner-rust/compare/v1.0.0...v1.0.3
## Changes * Fixes a typo Full Changelog: https://github.com/Hexagon/croner-rust/compare/v1.0.1...v1.0.2
Full Changelog: https://github.com/Hexagon/croner-rust/compare/v1.0.1...v1.0.2
Nothing published for this version
Introducing crate croner version 1.0.0 - a fully featured, lightweight and efficient Rust library for parsing and evaluating cron patterns.
Initial Stable Release
Introducing crate croner version 1.0.0 - a fully featured, lightweight and efficient Rust library for parsing and evaluating cron patterns.
Key Features:
@yearly, @monthly, @weekly, @daily, @hourly.Why Croner instead of Cron or Saffron?.
Usage Example showcasing is_time_matching, find_next_occurrence and iter_from:
use croner::Cron;
use chrono::Local;
// Example: Parse cron expression
let cron: Cron = "0 18 * * * FRI".parse().expect("Couldn't parse cron string");
// Example: Compare cron pattern with current local time
let time = Local::now();
let matches = cron.is_time_matching(&time).unwrap();
// Example: Get next match
let next = cron.find_next_occurrence(&time, false).unwrap();
// Output results
println!("Current time is: {}", time);
println!("Pattern \"{}\" does {} time {}", cron.pattern.to_string(), if matches { "match" } else { "not match" }, time );
println!("Pattern \"{}\" will match next time at {}", cron.pattern.to_string(), next);
// Example: Iterator
println!("Next 5 matches:");
for time in cron.clone().iter_from(Local::now()).take(5) {
println!("{}", time);
}
For detailed usage and API documentation, visit Croner on docs.rs and check out the README.
scheduler.tick() now returns a SchedulerResult (::Dead,::NoOp,::TaskTriggered or ::ThreadPoolExhausted) instead of bool
scheduler.tick() now returns a SchedulerResult (::Dead,::NoOp,::TaskTriggered or ::ThreadPoolExhausted) instead of boolFull Changelog: https://github.com/Hexagon/croner-rust/compare/v0.0.9...v0.0.10
## Changes * Add custom thread pool Full Changelog: https://github.com/Hexagon/croner-rust/compare/v0.0.8...v0.0.9
Full Changelog: https://github.com/Hexagon/croner-rust/compare/v0.0.8...v0.0.9
Cleanup, fixes and better use of thread pool
Full Changelog: https://github.com/Hexagon/croner-rust/compare/0.0.7...v0.0.8
## Changes * Add closest weekday W feature * Add threaded scheduler Full Changelog: https://github.com/Hexagon/croner-rust/compare/v0.0.6...0.0.7
W featureFull Changelog: https://github.com/Hexagon/croner-rust/compare/v0.0.6...0.0.7
## Changes * Huge performance improvements Full Changelog: https://github.com/Hexagon/croner-rust/compare/v0.0.5...v0.0.6
Full Changelog: https://github.com/Hexagon/croner-rust/compare/v0.0.5...v0.0.6
Reduces complexity of is_time_matching and find_next_occurrence
is_time_matching and find_next_occurrenceFull Changelog: https://github.com/Hexagon/croner-rust/compare/v0.0.4...v0.0.5
Add iterator function iter_from and iter_after
iter_from and iter_afterFull Changelog: https://github.com/Hexagon/croner-rust/compare/v0.0.3...v0.0.4
Add internal option dom_and_dow defaulting to false.
5#2 and 5#L).L.dom_and_dow defaulting to false.Full Changelog: https://github.com/Hexagon/croner-rust/compare/v0.0.2...v0.0.3
Nothing published for this version
Nothing published for this version
One column per quarter.