dragonmantank/cron-expression
CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due
v3.6.0
535M downloads/mo
#82 most downloaded on composer
dragonmantank/cron-expression
What this package is like to depend on
Last release 9 months ago
31 Oct 2025
Ships fairly regularly
a new release about every 10 months
Most releases are documented
notes for 23 of 29 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
29 releases · first in 2012
2 releases in the last 12 months
see the full history below
Release timeline
28 releases · Jul 2012 to Oct 2025Releases
latest 29-
v3.6.031 Oct 2025Release notes
Open source →What's Changed
- Dropped support for PHP older than 8.2 by @dragonmantank in #211
Full Changelog: v3.5.0...v3.6.0
-
v3.5.031 Oct 2025Release notes
Open source →What's Changed
- Remove webmozart assert dependency by @8ctopus in #192
- chore: upgrade phpstan, improve docblock for types by @Chris53897 in #207
- [ci] Add Tests for PHP 8.5 by @Chris53897 in #205
- Fix badges in README.md by @pierredup in #198
- fix: skipped run after daylight saving turnover point (#154) by @CipherdevNL in #203
- chore: remove PHPStan ignored errors by @Chris53897 in #208
- chore: bump github actions/checkout 4 => 5 by @Chris53897 in #210
New Contributors
- @pierredup made their first contribution in #198
- @CipherdevNL made their first contribution in #203
Full Changelog: v3.4.0...v3.5.0
-
v3.4.009 Oct 2024Release notes
Open source →What's Changed
- Tests against php 8.2 and 8.3 by @sergiy-petrov in #167
- explicitly mark nullable parameters as nullable by @xabbuh in #175
- chore: remove travis, and change status badge to github actions by @Chris53897 in #164
- chore: improve ci, fix deprecations, add php 8.2 tests by @Chris53897 in #163
- Remove duplicate
/phpstan.neonentry in .gitattributes by @TimWolla in #162 - Add branch-alias to composer.json by @nicolas-grekas in #182
- Add PHP 8.4 Support by @Jubeki in #190
- Remove phpstan/phpstan-webmozart-assert dependency by @8ctopus in #187
- Docs: full syntax overview by @mabar in #184
- Docs: new integrations by @mabar in #183
New Contributors
- @xabbuh made their first contribution in #175
- @Chris53897 made their first contribution in #164
- @nicolas-grekas made their first contribution in #182
- @Jubeki made their first contribution in #190
- @8ctopus made their first contribution in #187
- @mabar made their first contribution in #184
Full Changelog: v3.3.3...v3.4.0
-
v3.3.310 Aug 2023Release notes
Open source →[3.3.3] - 2024-08-10
Added
- N/A
Changed
- N/A
Fixed
- Added fixes for making sure
?is not passed for both DOM and DOW (#148, thank you https://github.com/LeoVie) - Fixed bug in Next Execution Time by sorting minutes properly (#160, thank you https://github.com/imyip)
Release notes
Open source →Added
- N/A
Changed
- N/A
Fixed
- Added fixes for making sure
?is not passed for both DOM and DOW (#148, thank you https://github.com/LeoVie) - Fixed bug in Next Execution Time by sorting minutes properly (#160, thank you https://github.com/imyip)
-
v3.3.210 Sep 2022Release notes
Open source →[3.3.2] - 2022-09-19
Added
- N/A
Changed
- Skip some daylight savings time tests for PHP 8.1 daylight savings time weirdness (#146)
Fixed
- Changed string interpolations to work better with PHP 8.2 (#142)
Release notes
Open source →Added
- N/A
Changed
- Skip some daylight savings time tests for PHP 8.1 daylight savings time weirdness (#146)
Fixed
- Changed string interpolations to work better with PHP 8.2 (#142)
-
v3.3.118 Jan 2022Release notes
Open source →[3.3.1] - 2022-01-18
Added
- N/A
Changed
- N/A
Fixed
- Fixed issue when timezones had no transition, which can occur over very short timespans (#134)
Release notes
Open source →Added
- N/A
Changed
- N/A
Fixed
- Fixed issue when timezones had no transition, which can occur over very short timespans (#134)
-
v3.3.014 Jan 2022Release notes
Open source →[3.3.0] - 2022-01-13
Added
- Added ability to register your own expression aliases (#132)
Changed
- Changed how Day of Week and Day of Month resolve when one or the other is
*or?
Fixed
- PHPStan should no longer error out
Release notes
Open source →Added
- Added ability to register your own expression aliases (#132)
Changed
- Changed how Day of Week and Day of Month resolve when one or the other is
*or?
Fixed
- PHPStan should no longer error out
-
v3.2.413 Jan 2022Release notes
Open source →[3.2.4] - 2022-01-12
Added
- N/A
Changed
- Changed how Day of Week increment/decrement to help with DST changes (#131)
Fixed
- N/A
Release notes
Open source →Added
- N/A
Changed
- Changed how Day of Week increment/decrement to help with DST changes (#131)
Fixed
- N/A
-
v3.2.306 Jan 2022Release notes
Open source →[3.2.3] - 2022-01-05
Added
- N/A
Changed
- Changed how minutes and hours increment/decrement to help with DST changes (#131)
Fixed
- N/A
Release notes
Open source →Added
- N/A
Changed
- Changed how minutes and hours increment/decrement to help with DST changes (#131)
Fixed
- N/A
-
v3.2.205 Jan 2022Release notes
Open source →Release notes
Open source →Added
- N/A
Changed
- Marked some methods
@internal(#124)
Fixed
- Fixed issue with small ranges and large steps that caused an error with
range()(#88) - Fixed issue where wraparound logic incorrectly considered high bound on range (#89)
-
v3.2.105 Jan 2022Release notes
Open source →Added
- N/A
Changed
- Added PHP 8.1 to testing (#125)
Fixed
- Allow better mixture of ranges, steps, and lists (#122)
- Fixed return order when multiple dates are requested and inverted (#121)
- Better handling over DST (#115)
- Fixed PHPStan tests (#130)
-
v3.2.005 Jan 2022Release notes
Open source →Added
- Added alias for
@midnight(#117)
Changed
- Improved testing for instance of field in tests (#105)
- Optimization for determining multiple run dates (#75)
CronExpressionproperties changed from private to protected (#106)
Fixed
- N/A
- Added alias for
-
v3.1.024 Nov 2020Release notes
Open source →Added
- Added
CronExpression::getParts()method to get parts of the expression as an array (#83)
Changed
- Changed to Interfaces for some type hints (#97, #86)
- Dropped minimum PHP version to 7.2
- Few syntax changes for phpstan compatibility (#93)
Fixed
- N/A
Deprecated
- Deprecated
CronExpression::factoryin favor of the constructor (#56) - Deprecated
CronExpression::YEARas a formality, the functionality is already removed (#87)
- Added
-
v3.0.213 Oct 2020Nothing published for this version
-
3.0.121 Aug 2020 -
v3.0.025 Mar 2020Release notes
Open source →MAJOR CHANGE - In previous versions of this library, setting both a "Day of Month" and a "Day of Week" would be interpreted as an
ANDstatement, not anORstatement. For example:30 0 1 * 1would evaluate to "Run 30 minutes after the 0 hour when the Day Of Month is 1 AND a Monday" instead of "Run 30 minutes after the 0 hour on Day Of Month 1 OR a Monday", where the latter is more inline with most cron systems. This means that if your cron expression has both of these fields set, you may see your expression fire more often starting with v3.0.0.
Added
- Additional docblocks for IDE and documentation
- Added phpstan as a development dependency
- Added a
Cron\FieldFactoryInterfaceto make migrations easier (#38)
Changed
- Changed some DI testing during TravisCI runs
\Cron\CronExpression::determineTimezone()now checks for\DateTimeInterfaceinstead of just\DateTime- Errors with fields now report a more human-understandable error and are 1-based instead of 0-based
- Better support for
\DateTimeImmutableacross the library by typehinting for\DateTimeInterfacenow - Literals should now be less case-sensative across the board
- Changed logic for when both a Day of Week and a Day of Month are supplied to now be an OR statement, not an AND
Fixed
- Fixed infinite loop when determining last day of week from literals
- Fixed bug where single number ranges were allowed (ex:
1/10) - Fixed nullable FieldFactory in CronExpression where no factory could be supplied
- Fixed issue where logic for dropping seconds to 0 could lead to a timezone change
-
v2.3.113 Oct 2020 -
v2.3.031 Mar 2019Release notes
Open source →Added
- Added support for DateTimeImmutable via DateTimeInterface
- Added support for PHP 7.3
- Started listing projects that use the library
Changed
- Errors should now report a human readable position in the cron expression, instead of starting at 0
Fixed
- N/A
-
v2.2.006 Jun 2018 -
v2.1.006 Apr 2018Release notes
Open source →Added
- N/A
Changed
- Upgraded to PHPUnit 6 (#2)
Fixed
- Refactored timezones to deal with some inconsistent behavior (#3)
- Allow ranges and lists in same expression (#5)
- Fixed regression where literals were not converted to their numerical counterpart (#)
-
v2.0.012 Oct 2017Release notes
Open source →Added
- N/A
Changed
- Dropped support for PHP 5.x
- Dropped support for the YEAR field, as it was not part of the cron standard
Fixed
- Reworked validation for all the field types
- Stepping should now work for 1-indexed fields like Month (#153)
-
v1.2.123 Jan 2017Nothing published for this version
-
v1.2.0no dateRelease notes
Open source →Added
- Added IDE, CodeSniffer, and StyleCI.IO support
Changed
- Switched to PSR-4 Autoloading
Fixed
- 0 step expressions are handled better
- Fixed
DayOfMonthvalidation to be more strict - Typos
-
v1.1.026 Jan 2016Release notes
Open source →Added
- Support for non-hourly offset timezones
- Checks for valid expressions
Changed
- Max Iterations no longer hardcoded for
getRunDate() - Supports DateTimeImmutable for newer PHP verions
Fixed
- Fixed looping bug for PHP 7 when determining the last specified weekday of a month
-
v1.0.411 Jan 2015Nothing published for this version
-
v1.0.323 Nov 2013Release notes
Open source →Added
- Now supports expressions with any number of extra spaces, tabs, or newlines
Changed
- Using static instead of self in
CronExpression::factory
Fixed
-
v1.0.205 Apr 2013Nothing published for this version
-
v1.0.106 Mar 2013Nothing published for this version
-
v1.0.015 Jul 2012Nothing published for this version