PHPackages                             rlanvin/php-rrule - 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. rlanvin/php-rrule

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

rlanvin/php-rrule
=================

Lightweight and fast recurrence rules for PHP (RFC 5545)

v2.6.0(1y ago)69810.6M—2.4%92[3 issues](https://github.com/rlanvin/php-rrule/issues)[2 PRs](https://github.com/rlanvin/php-rrule/pulls)20MITPHPPHP &gt;=5.6.0CI passing

Since Mar 2Pushed 11mo ago19 watchersCompare

[ Source](https://github.com/rlanvin/php-rrule)[ Packagist](https://packagist.org/packages/rlanvin/php-rrule)[ Docs](https://github.com/rlanvin/php-rrule)[ RSS](/packages/rlanvin-php-rrule/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (40)Used By (20)

RRULE for PHP
=============

[](#rrule-for-php)

Lightweight and fast implementation of recurrence rules for PHP (`RRULE` from RFC 5545), to easily calculate recurring/repeating dates and events (such as in a calendar). This library started as a port of [python-dateutil](https://labix.org/python-dateutil).

[![Build status](https://github.com/rlanvin/php-rrule/workflows/Tests/badge.svg)](https://github.com/rlanvin/php-rrule/actions)[![Latest Stable Version](https://camo.githubusercontent.com/bc8cc9760202b439e63cc4bc1615f7b5ddb12cec85a819ee112ec44130c5ebdb/68747470733a2f2f706f7365722e707567782e6f72672f726c616e76696e2f7068702d7272756c652f762f737461626c65)](https://packagist.org/packages/rlanvin/php-rrule)[![Total Downloads](https://camo.githubusercontent.com/2de96b444a9e9dba1da665a27d3c53aaaf4b37eed0cf0e39c3ffc304d3b21544/68747470733a2f2f706f7365722e707567782e6f72672f726c616e76696e2f7068702d7272756c652f646f776e6c6f616473)](https://packagist.org/packages/rlanvin/php-rrule)

Basic example
-------------

[](#basic-example)

```
use RRule\RRule;

$rrule = new RRule([
	'FREQ' => 'MONTHLY',
	'INTERVAL' => 1,
	'DTSTART' => '2015-06-01',
	'COUNT' => 6
]);

foreach ($rrule as $occurrence) {
	echo $occurrence->format('D d M Y'),", ";
}
// Mon 01 Jun 2015, Wed 01 Jul 2015, Sat 01 Aug 2015, Tue 01 Sep 2015, Thu 01 Oct 2015, Sun 01 Nov 2015

echo $rrule->humanReadable(),"\n";
// monthly on the 1st of the month, starting from 01/06/2015, 6 times
```

Complete documentation and more examples are available in [the wiki](https://github.com/rlanvin/php-rrule/wiki).

Requirements
------------

[](#requirements)

- PHP &gt;= 7.3
- [intl extension](http://php.net/manual/en/book.intl.php) is recommended for `humanReadable()` but not strictly required

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

[](#installation)

The recommended way is to install the lib [through Composer](http://getcomposer.org/).

Simply run `composer require rlanvin/php-rrule` for it to be automatically installed and included in your `composer.json`.

Now you can use the autoloader, and you will have access to the library:

```
require 'vendor/autoload.php';
```

Documentation
-------------

[](#documentation)

Complete documentation is available in [the wiki](https://github.com/rlanvin/php-rrule/wiki).

You will also find useful information in the [RFC 5545 section 3.3.10](https://tools.ietf.org/html/rfc5545#section-3.3.10).

Contribution
------------

[](#contribution)

Feel free to contribute! Just create a new issue or a new pull request.

The coding style is (mostly) PSR-2, but with tabs.

### Translation

[](#translation)

Use `./bin/review_translations.php --locale ` to print a list of examples using the locale specified (default is English). Use `./bin/review_translations.php --rule ""` to test a specific rule in all available locales.

Note
----

[](#note)

I started this library because I wasn't happy with the existing implementations in PHP, so I thought it would be a good learning project to port the python-dateutil rrule implementation into PHP.

The Python lib was a bit difficult to understand because the algorithms are not commented and the variables are very opaque (I'm looking at you `lno1wkst`). I tried to comment and explain as much of the algorithm as possible in this PHP port, so feel free to check the code if you're interested.

The lib differs from the python version in various aspects, notably in the respect of the RFC. This version is a bit stricter and will not accept many non-compliant combinations of rule parts, that the python version otherwise accepts. There are also some additional features in this version.

License
-------

[](#license)

This library is released under the MIT License.

###  Health Score

61

—

FairBetter than 99% of packages

Maintenance50

Moderate activity, may be stable

Popularity69

Solid adoption and visibility

Community44

Growing community involvement

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 82% 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 ~115 days

Recently: every ~172 days

Total

30

Last Release

389d ago

Major Versions

v1.6.3 → v2.0.0-rc12019-01-13

PHP version history (2 changes)v1.0.0PHP &gt;=5.3.0

v2.0.0-rc1PHP &gt;=5.6.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/244b4ba7915b07666db1347123ec2b322413cec2e6fd1ef81545def0dcdf82e9?d=identicon)[rlanvin](/maintainers/rlanvin)

---

Top Contributors

[![rlanvin](https://avatars.githubusercontent.com/u/1701590?v=4)](https://github.com/rlanvin "rlanvin (168 commits)")[![erickr](https://avatars.githubusercontent.com/u/89317?v=4)](https://github.com/erickr "erickr (2 commits)")[![gordonzhao](https://avatars.githubusercontent.com/u/16530394?v=4)](https://github.com/gordonzhao "gordonzhao (2 commits)")[![ShoresOfNowhere](https://avatars.githubusercontent.com/u/20368249?v=4)](https://github.com/ShoresOfNowhere "ShoresOfNowhere (2 commits)")[![cedric-anne](https://avatars.githubusercontent.com/u/33253653?v=4)](https://github.com/cedric-anne "cedric-anne (2 commits)")[![superdav42](https://avatars.githubusercontent.com/u/1534605?v=4)](https://github.com/superdav42 "superdav42 (2 commits)")[![bierpub](https://avatars.githubusercontent.com/u/5347727?v=4)](https://github.com/bierpub "bierpub (2 commits)")[![antitoine](https://avatars.githubusercontent.com/u/10686594?v=4)](https://github.com/antitoine "antitoine (2 commits)")[![dexamenos](https://avatars.githubusercontent.com/u/33360918?v=4)](https://github.com/dexamenos "dexamenos (2 commits)")[![marcorivm](https://avatars.githubusercontent.com/u/1222598?v=4)](https://github.com/marcorivm "marcorivm (1 commits)")[![marvinrabe](https://avatars.githubusercontent.com/u/515860?v=4)](https://github.com/marvinrabe "marvinrabe (1 commits)")[![mromero91](https://avatars.githubusercontent.com/u/6876525?v=4)](https://github.com/mromero91 "mromero91 (1 commits)")[![nilsenpaul](https://avatars.githubusercontent.com/u/6794819?v=4)](https://github.com/nilsenpaul "nilsenpaul (1 commits)")[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")[![rickywiens](https://avatars.githubusercontent.com/u/675907?v=4)](https://github.com/rickywiens "rickywiens (1 commits)")[![roikedem](https://avatars.githubusercontent.com/u/1977662?v=4)](https://github.com/roikedem "roikedem (1 commits)")[![rriverak](https://avatars.githubusercontent.com/u/7319154?v=4)](https://github.com/rriverak "rriverak (1 commits)")[![Solinx](https://avatars.githubusercontent.com/u/2049212?v=4)](https://github.com/Solinx "Solinx (1 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (1 commits)")[![thetos7](https://avatars.githubusercontent.com/u/33055824?v=4)](https://github.com/thetos7 "thetos7 (1 commits)")

---

Tags

datesicalendarphprecurrencerruledaterecurringrrulerecurrenceical

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rlanvin-php-rrule/health.svg)

```
[![Health](https://phpackages.com/badges/rlanvin-php-rrule/health.svg)](https://phpackages.com/packages/rlanvin-php-rrule)
```

###  Alternatives

[simshaun/recurr

PHP library for working with recurrence rules

1.6k15.7M40](/packages/simshaun-recurr)[tplaner/when

Date/Calendar recursion library.

5261.0M5](/packages/tplaner-when)[wilianx7/php-recurring

PHP library to make getting dates easier when working with recurring tasks.

1045.0k](/packages/wilianx7-php-recurring)

PHPackages © 2026

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