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

ActiveLibrary

vanushwashere/cron-expression-php5
==================================

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

v1.2.0.3(8y ago)0674MITPHPPHP &gt;=5.6

Since Jul 15Pushed 8y agoCompare

[ Source](https://github.com/vanushwashere/cron-expression)[ Packagist](https://packagist.org/packages/vanushwashere/cron-expression-php5)[ RSS](/packages/vanushwashere-cron-expression-php5/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (3)Dependencies (1)Versions (11)Used By (0)

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

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

### THIS IS JUST REFACTORED [mtdowling/cron-expression](https://github.com/mtdowling/cron-expression "mtdowling/cron-expression") PACKAGE TO WORK WITH PHP 5.6+

[](#this-is-just-refactored-mtdowlingcron-expression-package-to-work-with-php-56)

[![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)

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)

```
