{"id":13704613,"url":"https://github.com/poliander/cron","last_synced_at":"2026-01-11T06:46:34.786Z","repository":{"id":21214390,"uuid":"24527325","full_name":"poliander/cron","owner":"poliander","description":"Parse and validate crontab expressions in PHP","archived":false,"fork":false,"pushed_at":"2024-10-12T11:32:30.000Z","size":143,"stargazers_count":63,"open_issues_count":0,"forks_count":10,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-20T09:18:05.454Z","etag":null,"topics":["cron","crontab","expression","parser","php","validation"],"latest_commit_sha":null,"homepage":"https://github.com/poliander/cron","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/poliander.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-09-27T08:38:15.000Z","updated_at":"2024-10-17T16:42:03.000Z","dependencies_parsed_at":"2024-01-20T16:49:20.723Z","dependency_job_id":"39d35f8e-3c68-431d-b19d-e59b21d37f26","html_url":"https://github.com/poliander/cron","commit_stats":{"total_commits":203,"total_committers":5,"mean_commits":40.6,"dds":"0.46798029556650245","last_synced_commit":"cea382e5f184bf18a3c2ca6ff905cd3f39cb3ce5"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poliander%2Fcron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poliander%2Fcron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poliander%2Fcron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/poliander%2Fcron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/poliander","download_url":"https://codeload.github.com/poliander/cron/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224440022,"owners_count":17311573,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cron","crontab","expression","parser","php","validation"],"created_at":"2024-08-02T21:01:13.543Z","updated_at":"2025-05-05T10:30:37.111Z","avatar_url":"https://github.com/poliander.png","language":"PHP","readme":"# PHP Cron Expression Parser\n\n[![Build Status](https://scrutinizer-ci.com/g/poliander/cron/badges/build.png?b=main)](https://scrutinizer-ci.com/g/poliander/cron/build-status/main)\n[![Code Coverage](https://scrutinizer-ci.com/g/poliander/cron/badges/coverage.png?b=main)](https://scrutinizer-ci.com/g/poliander/cron/?branch=main)\n[![License](https://poser.pugx.org/poliander/cron/license)](https://www.gnu.org/licenses/gpl-3.0.en.html)\n[![Latest Stable Version](https://poser.pugx.org/poliander/cron/v/stable)](https://packagist.org/packages/poliander/cron)\n[![Total Downloads](https://poser.pugx.org/poliander/cron/downloads)](https://packagist.org/packages/poliander/cron)\n\nStandard (V7) compliant crontab expression parser/validator with support for time zones; see \"[man 5 crontab](http://www.unix.com/man-page/linux/5/crontab/)\" for possible expressions.\n\n\u003c!-- toc --\u003e\n\n- [Installation](#installation)\n- [Examples](#examples)\n- [Supported PHP Versions](#supported-php-versions)\n- [Changelog](#changelog)\n\n\u003c!-- tocstop --\u003e\n\n## Installation\n\nUsing composer, add a requirement for `poliander/cron` to your `composer.json` file:\n```\ncomposer require poliander/cron\n```\n\n## Examples\n\nValidate a certain crontab expression:\n```php\nuse Poliander\\Cron\\CronExpression;\n\n$expression = new CronExpression('15,45 */2 * * *');\n$isValid = $expression-\u003eisValid(); // returns true\n```\n\nCheck whether a given point in time is matching a certain cron expression:\n```php\nuse Poliander\\Cron\\CronExpression;\n\n$expression = new CronExpression('45 9 * * *');\n$dt = new \\DateTime('2014-05-18 09:45');\n$isMatching = $expression-\u003eisMatching($dt); // returns true\n```\n\nMatch an expression across different time zones:\n```php\nuse Poliander\\Cron\\CronExpression;\n\n$expression = new CronExpression('45 9 * * *', new DateTimeZone('Europe/Berlin'));\n$dt = new \\DateTime('2014-05-18 08:45', new DateTimeZone('Europe/London'));\n$isMatching = $expression-\u003eisMatching($dt); // returns true\n```\n\nCalculate next timestamp matching a Friday, the 13th:\n```php\nuse Poliander\\Cron\\CronExpression;\n\n$expression = new CronExpression('* * 13 * fri');\n$when = $expression-\u003egetNext();\n```\n\n## Supported PHP Versions\n\n| cron  | PHP       | Note        |\n| ----- | --------- | ----------- |\n| 1.2.* | 5.6       | end of life |\n| 2.0.* | 7.0       | end of life |\n| 2.1.* | 7.1       | end of life |\n| 2.2.* | 7.2       | end of life |\n| 2.3.* | 7.3       | end of life |\n| 2.4.* | 7.4 - 8.2 | end of life |\n| 3.0.* | 7.4 - 8.2 | end of life |\n| 3.1.* | 8.1 - 8.3 | end of life |\n| 3.2.* | 8.2 - 8.4 |             |\n\n## Changelog\n\n| version | release notes |\n| ------------------ | --------------- |\n| 1.0.0 (2015-06-20) | initial release |\n| 1.1.0 (2016-06-11) | dropped PHP 5.4 support |\n| 1.2.0 (2016-12-11) | added PHP 7.1 support |\n| 1.2.1 (2017-05-25) | ~~fixed #3~~ |\n| 1.2.2 (2017-06-03) | fixed #3, #4 |\n| 2.0.0 (2017-11-30) | dropped PHP 5.x, added PHP 7.2 support, added vendor namespace (closes #2) |\n| 2.1.0 (2018-12-08) | dropped PHP 7.0, added PHP 7.3 support, updated PHPUnit dependency to 7.* |\n| 2.2.0 (2019-12-03) | dropped PHP 7.1, added PHP 7.4 support, updated PHPUnit dependency to 8.* |\n| 2.3.0 (2020-12-29) | dropped PHP 7.2, added PHP 8.0 support, updated PHPUnit dependency to 9.* |\n| 2.3.1 (2021-10-04) | fixed #6 |\n| 2.4.0 (2021-12-27) | dropped PHP 7.3, added PHP 8.1 support |\n| 2.4.1 (2022-03-25) | ~~fixed #9~~ |\n| 2.4.2 (2022-04-09) | fixed #9, #10, #11 |\n| 2.4.3 (2022-04-10) | fixed #12 |\n| 2.4.4 (2022-04-11) | fixed #13 |\n| 2.4.5 (2022-12-17) | fixed #14 |\n| 2.4.6 (2022-12-29) | added PHP 8.2 support |\n| 2.4.7 (2023-01-20) | fixed #16 |\n| 2.4.8 (2023-07-30) | fixed #18, #19 |\n| 2.4.9 (2023-10-28) | fixed #22 |\n| 3.0.0 (2022-04-09) | namespace changed to avoid package conflict (closes #8) |\n| 3.0.1 (2022-04-10) | fixed #12 |\n| 3.0.2 (2022-04-11) | fixed #13 |\n| 3.0.3 (2022-12-17) | fixed #14 |\n| 3.0.4 (2022-12-29) | added PHP 8.2 support |\n| 3.0.5 (2023-01-20) | fixed #16 |\n| 3.0.6 (2023-07-30) | fixed #18, #19 |\n| 3.0.7 (2023-10-28) | fixed #22 |\n| 3.1.0 (2023-11-23) | added PHP 8.3 support, dropped PHP 7/8.0 support, updated PHPUnit to 10.* |\n| 3.2.0 (2024-11-22) | added PHP 8.4 support, dropped PHP 8.1 support, updated PHPUnit to 11.* |\n| 3.2.1 (2024-12-21) | fixed #26 |\n","funding_links":[],"categories":["目录","类库"],"sub_categories":["任务运行者 Task Runners","未归类"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoliander%2Fcron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpoliander%2Fcron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpoliander%2Fcron/lists"}