PHPackages                             mtmaxtech/cron-expression - 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. mtmaxtech/cron-expression

Abandoned → [dragonmantank/cron-expression](/?search=dragonmantank%2Fcron-expression)Library

mtmaxtech/cron-expression
=========================

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

v1.2.3(6y ago)08MITPHPPHP &gt;=5.3.2

Since Jul 15Pushed 5y agoCompare

[ Source](https://github.com/mtmaxtech/cron-expression)[ Packagist](https://packagist.org/packages/mtmaxtech/cron-expression)[ RSS](/packages/mtmaxtech-cron-expression/feed)WikiDiscussions master Synced 1w ago

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

PHP Cron Expression Parser
==========================

[](#php-cron-expression-parser)

[![Latest Stable Version](https://camo.githubusercontent.com/35ef0ae8948080a9f8e148f5e2535c7d76166e88ee94f73a54484efe5e59c686/68747470733a2f2f706f7365722e707567782e6f72672f6d74646f776c696e672f63726f6e2d65787072657373696f6e2f762f737461626c652e706e67)](https://packagist.org/packages/mtdowling/cron-expression) [![Total Downloads](https://camo.githubusercontent.com/c783eeb93b572daee057a7258bc725452f7e3581c9fc7989b4f8fb2e8f63d09b/68747470733a2f2f706f7365722e707567782e6f72672f6d74646f776c696e672f63726f6e2d65787072657373696f6e2f646f776e6c6f6164732e706e67)](https://packagist.org/packages/mtdowling/cron-expression) [![Build Status](https://camo.githubusercontent.com/093cdc8d636545913c076a55092311dad6082d11af8d3241ca4917bb8ed83b5c/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6d74646f776c696e672f63726f6e2d65787072657373696f6e2e706e67)](http://travis-ci.org/mtdowling/cron-expression)

**NOTE** This fork has been deprecated and development moved to . More information can be found in the blog post [here](http://ctankersley.com/2017/10/12/cron-expression-update/). tl;dr - v2.0.0 is a major breaking change, and @dragonmantank can better take care of the project in a separate fork.

The PHP cron expression parser can parse a CRON expression, determine if it is due to run, calculate the next run date of the expression, and calculate the previous run date of the expression. You can calculate dates far into the future or past by skipping n number of matching dates.

The parser can handle increments of ranges (e.g. \*/12, 2-59/3), intervals (e.g. 0-9), lists (e.g. 1,2,3), W to find the nearest weekday for a given day of the month, L to find the last day of the month, L to find the last given weekday of a month, and hash (#) to find the nth weekday of a given month.

Installing
==========

[](#installing)

Add the dependency to your project:

```
composer require mtdowling/cron-expression
```

Usage
=====

[](#usage)

```
