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

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

darthsteven/cron-expression-hash
================================

Hashing enabled CRON for PHP

1.0.0(10y ago)021MITPHPPHP &gt;=5.3.2

Since Jun 5Pushed 10y ago1 watchersCompare

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

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

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

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

[![Latest Stable Version](https://camo.githubusercontent.com/e2643114b8e5bc40a87f97c3a3184f070cdc7be6e8a1ccbd7e87a736f55343bb/68747470733a2f2f706f7365722e707567782e6f72672f646172746873746576656e2f63726f6e2d65787072657373696f6e2d686173682f762f737461626c652e706e67)](https://packagist.org/packages/darthsteven/cron-expression-hash) [![Total Downloads](https://camo.githubusercontent.com/3a8156eab85251ebdbc75b593f02ac98b159b9caa0a8edf430df746b7f2ccc87/68747470733a2f2f706f7365722e707567782e6f72672f646172746873746576656e2f63726f6e2d65787072657373696f6e2d686173682f646f776e6c6f6164732e706e67)](https://packagist.org/packages/darthsteven/cron-expression-hash) [![Build Status](https://camo.githubusercontent.com/191490ca2cc76443cfbdfd48af6370f304087d48dbcaaec0f3687ab755bf5ef1/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f646172746873746576656e2f63726f6e2d65787072657373696f6e2d686173682e706e67)](http://travis-ci.org/darthsteven/cron-expression-hash)

This builds upon the fine work done by Michael Dowling in the base [PHP Cron Expression Parser library](https://github.com/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.

Additionally you can also use the literal H instead of a number in most fields and then supply some data to be hashed internally to produce a stable random number instead of H. This allows running lots of different tasks with an hourly schedule: 'H \* \* \* \*' but having them actually run at different minutes during the hours.

Installing
==========

[](#installing)

Add the dependency to your project:

```
composer require darthsteven/cron-expression-hash
```

Usage
=====

[](#usage)

```
