PHPackages                             heartsentwined/cron-expr-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. heartsentwined/cron-expr-parser

ActiveLibrary

heartsentwined/cron-expr-parser
===============================

Parse cron expressions and match them against time.

v2.0.5(9y ago)412.0k5ISCPHPPHP &gt;=5.3.3

Since Sep 19Pushed 9y ago3 watchersCompare

[ Source](https://github.com/heartsentwined/php-cron-expr-parser)[ Packagist](https://packagist.org/packages/heartsentwined/cron-expr-parser)[ Docs](https://github.com/yalesov/php-cron-expr-parser)[ RSS](/packages/heartsentwined-cron-expr-parser/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (11)Used By (0)

Yalesov\\CronExprParser
=======================

[](#yalesovcronexprparser)

[![Build Status](https://camo.githubusercontent.com/74707b668dcea62fad2fb462e39a78b3c87f1c771b81e42f4d60e1958ebb2c21/68747470733a2f2f7472617669732d63692e6f72672f79616c65736f762f7068702d63726f6e2d657870722d7061727365722e737667)](https://travis-ci.org/yalesov/php-cron-expr-parser)

Parse cron expressions and match them against time.

Installation
============

[](#installation)

[Composer](http://getcomposer.org/):

```
{
  "require": {
    "yalesov/cron-expr-parser": "2.*"
  }
}
```

Usage
=====

[](#usage)

Parse a Cron expression and a time, and determine if the given time falls within the given cron expression.

```
use Yalesov\CronExprParser\Parser;
$match    = Parse::matchTime('next Thursday', '* * * * 4');
$notMatch = Parse::matchTime('next Friday', '* * * * 4');
```

Function signature:

```
public static function matchTime($time, $expr)
```

`$time` is either a timestamp, or a [`strtotime`](http://php.net/manual/en/function.strtotime.php)-compatible string.

`$expr` is any valid cron expression, in addition supporting:

- range: `0-5`
- range + interval: `10-59/5`
- comma-separated combinations of these: `1,4,7,10-20`
- English months: `january`
- English months (abbreviated to three letters): `jan`
- English weekdays: `monday`
- English weekdays (abbreviated to three letters): `mon`
- These text counterparts can be used in all places where their numerical counterparts are allowed, e.g. `jan-jun/2`
- A full example: `0-5,10-59/5 * 2-10,15-25 january-june/2 mon-fri` (every minute between minute 0-5 + every 5th minute between 10-59; every hour; every day between day 2-10 and day 15-25; every 2nd month between January-June; Monday-Friday)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 90.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~154 days

Recently: every ~0 days

Total

10

Last Release

3595d ago

Major Versions

0.1.0 → 1.0.02012-09-19

1.0.2 → v2.0.02016-07-05

### Community

Maintainers

![](https://www.gravatar.com/avatar/e2fd4399d9df9ec84c5064fc5b9fcdaa3e6edf9049882227efa46f24b40db67b?d=identicon)[heartsentwined](/maintainers/heartsentwined)

---

Top Contributors

[![yalesov](https://avatars.githubusercontent.com/u/20264293?v=4)](https://github.com/yalesov "yalesov (10 commits)")[![BnitoBzh](https://avatars.githubusercontent.com/u/2962152?v=4)](https://github.com/BnitoBzh "BnitoBzh (1 commits)")

---

Tags

cron

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/heartsentwined-cron-expr-parser/health.svg)

```
[![Health](https://phpackages.com/badges/heartsentwined-cron-expr-parser/health.svg)](https://phpackages.com/packages/heartsentwined-cron-expr-parser)
```

###  Alternatives

[dragonmantank/cron-expression

CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due

4.7k474.1M486](/packages/dragonmantank-cron-expression)[studio/laravel-totem

A Laravel package to manage your cron jobs through a beautiful dashboard

1.8k1.1M](/packages/studio-laravel-totem)[lorisleiva/cron-translator

Makes CRON expressions human-readable

3148.5M31](/packages/lorisleiva-cron-translator)[zenstruck/schedule-bundle

Schedule Cron jobs (commands/callbacks/bash scripts) within your Symfony application.

4041.0M2](/packages/zenstruck-schedule-bundle)[crunzphp/crunz

Schedule your tasks right from the code.

2292.0M6](/packages/crunzphp-crunz)[omnilight/yii2-scheduling

Scheduling extension for Yii2 framework

3181.0M7](/packages/omnilight-yii2-scheduling)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
