A PHP library for parsing CRON expressions, calculating next/previous run dates, and determining if a schedule is due.
Cron Expression is a PHP library for parsing and working with CRON expressions. It allows developers to calculate the next or previous run dates for any CRON schedule, determine if a schedule is due, and handle complex scheduling logic programmatically within PHP applications.
PHP developers building applications that require programmatic task scheduling, cron job management, or date calculation based on CRON expressions.
It provides a comprehensive, standalone solution for CRON expression parsing in PHP with support for advanced syntax features, making it more flexible than basic date/time functions and eliminating the need to rely on system cron for schedule calculations.
CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Parses complex CRON expressions including ranges with steps (e.g., 2-59/3), nearest weekday (W), last day of month (L), and predefined shorthands like @daily, as demonstrated in the README examples.
Offers an intuitive factory method and functions like isDue(), getNextRunDate(), and getPreviousRunDate(), making integration straightforward for basic and complex schedules.
Accurately calculates future and past run dates, even for multiple iterations, with methods to skip n matching dates, as shown in the usage code.
With high download counts and stable versions on Packagist, it's a widely adopted library in the PHP ecosystem, indicating reliability.
The README explicitly states this fork is deprecated, with development moved to dragonmantank/cron-expression, meaning no future updates, bug fixes, or security patches.
Version 2.0.0 introduced major breaking changes, which can disrupt existing implementations and require significant refactoring for upgrades.
The library doesn't handle timezones natively, forcing developers to manage conversions externally, adding complexity for multi-timezone applications.
It only parses standard cron expressions and doesn't integrate with modern job queues or support alternative scheduling formats, reducing flexibility for broader use cases.