PHPackages                             tomk/cronparser - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tomk/cronparser

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tomk/cronparser
===============

Parse CRON format and check for time matches, or get next/previous match

45751PHP

Since Sep 4Pushed 11y ago1 watchersCompare

[ Source](https://github.com/TomK/CronParser)[ Packagist](https://packagist.org/packages/tomk/cronparser)[ RSS](/packages/tomk-cronparser/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

CronParser
==========

[](#cronparser)

[![Build Status](https://camo.githubusercontent.com/3880205a29550a82e24bf5188da5109fc840a5c5541dc3bb21dc320e8ceb767a/68747470733a2f2f7472617669732d63692e6f72672f546f6d4b2f43726f6e5061727365722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/TomK/CronParser) [![Total Downloads](https://camo.githubusercontent.com/89c1d715a3399c90f68ed6bdf353a78a56a836c0e61909dd32519d8feb318a0b/68747470733a2f2f706f7365722e707567782e6f72672f746f6d6b2f63726f6e7061727365722f646f776e6c6f6164732e737667)](https://packagist.org/packages/tomk/cronparser)

PHP class to parse CRON format and check for time matches, or determine next and previous matching times.

Installation
------------

[](#installation)

Add this package to your composer.json required section

```
"required": {
  "tomk/cronparser":"*"
}

```

Usage
-----

[](#usage)

The following public methods are available.

```
// Returns true if pattern is valid format, false otherwise
CronParser::isValid(string $pattern);

// Returns true if the time matches the pattern supplied.
CronParser::isDue(string $pattern [, $time = time()]);

// Returns a DateTime object of the next matching time from $time.
// If $now is true, will accept $time as a match. Otherwise finds the next match in the future.
CronParser::nextRun(string $pattern [, $time = time() [, $now = false]]);

// Returns a DateTime object of the previous matching time from $time.
// If $now is true, will accept $time as a match. Otherwise finds the next match in the past.
CronParser::prevRun(string $pattern [, $time = time() [, $now = false]]);
```

CRON expression
---------------

[](#cron-expression)

Please see CRON format on wikipedia for reference: \[[http://en.wikipedia.org/wiki/Cron#CRON\_expression](http://en.wikipedia.org/wiki/Cron#CRON_expression)\]

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/299656?v=4)[Tom Kay](/maintainers/tomk)[@TomK](https://github.com/TomK)

---

Top Contributors

[![TomK](https://avatars.githubusercontent.com/u/299656?v=4)](https://github.com/TomK "TomK (13 commits)")

### Embed Badge

![Health badge](/badges/tomk-cronparser/health.svg)

```
[![Health](https://phpackages.com/badges/tomk-cronparser/health.svg)](https://phpackages.com/packages/tomk-cronparser)
```

###  Alternatives

[gonetone/laravel-boost-windsurf-extension

Laravel Boost extension package that provides Windsurf editor and Windsurf JetBrains plugin integration.

239.1k](/packages/gonetone-laravel-boost-windsurf-extension)[adereldo/correios

Consulta de cep,rastreio em site do correios

121.4k](/packages/adereldo-correios)

PHPackages © 2026

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