PHPackages                             starx/when - 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. starx/when

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

starx/when
==========

Date/Calendar recursion library.

v0.4(9y ago)01.9kMITPHPPHP &gt;=5.3.0

Since Jun 16Pushed 9y ago1 watchersCompare

[ Source](https://github.com/starx/When)[ Packagist](https://packagist.org/packages/starx/when)[ Docs](https://github.com/tplaner/When)[ RSS](/packages/starx-when/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)DependenciesVersions (3)Used By (0)

\##When Date/Calendar recursion library for PHP 5.3+

[![Build Status](https://camo.githubusercontent.com/cc1a395910877774fea57a223dcf11e61101fd94597409736dca5ae0579b8d51/68747470733a2f2f7472617669732d63692e6f72672f74706c616e65722f5768656e2e706e673f6272616e63683d646576656c6f70)](https://travis-ci.org/tplaner/When)

Author: Tom Planer

\###About The second version of When.

\###Current Features Currently this version does everything version 1 was capable of, it also supports byhour, byminute, and bysecond. Please check the [unit tests](https://github.com/tplaner/When/tree/develop/tests) for information about how to use it.

I will be replacing version 1 with this as soon as I complete the documentation. Until then here are some simple examples:

```
// friday the 13th for the next 5 occurrences
$r = new When();
$r->startDate(new DateTime("19980213T090000"))
  ->freq("monthly")
  ->count(5)
  ->byday("fr")
  ->bymonthday(13)
  ->generateOccurrences();

print_r($r->occurrences);

// friday the 13th for the next 5 occurrences rrule
$r = new When();
$r->startDate(new DateTime("19980213T090000"))
  ->rrule("FREQ=MONTHLY;BYDAY=FR;BYMONTHDAY=13")
  ->generateOccurrences();

print_r($r->occurrences);

```

\###License When is licensed under the MIT License, see `LICENSE` for specific details.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

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

Unknown

Total

1

Last Release

3425d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d62aa9ddd1758dd002c3b34d8524c0ec0058b89f73544b5ffcdba7ac3ca491e5?d=identicon)[starx](/maintainers/starx)

---

Top Contributors

[![tplaner](https://avatars.githubusercontent.com/u/50652?v=4)](https://github.com/tplaner "tplaner (42 commits)")[![jamespaulmuir](https://avatars.githubusercontent.com/u/79559?v=4)](https://github.com/jamespaulmuir "jamespaulmuir (3 commits)")[![deldreth](https://avatars.githubusercontent.com/u/233009?v=4)](https://github.com/deldreth "deldreth (1 commits)")[![DonaldGoose](https://avatars.githubusercontent.com/u/401283?v=4)](https://github.com/DonaldGoose "DonaldGoose (1 commits)")[![justinethier](https://avatars.githubusercontent.com/u/153000?v=4)](https://github.com/justinethier "justinethier (1 commits)")[![UltraSimplified](https://avatars.githubusercontent.com/u/522171?v=4)](https://github.com/UltraSimplified "UltraSimplified (1 commits)")

---

Tags

datetimetimedaterecurrence

### Embed Badge

![Health badge](/badges/starx-when/health.svg)

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

###  Alternatives

[tplaner/when

Date/Calendar recursion library.

5331.1M8](/packages/tplaner-when)[league/period

Time range API for PHP

7335.8M23](/packages/league-period)[brick/date-time

Date and time library

3663.8M102](/packages/brick-date-time)[aeon-php/calendar

PHP type safe, immutable calendar library

20810.4M16](/packages/aeon-php-calendar)[kartik-v/php-date-formatter

A Javascript datetime formatting and manipulation library using PHP date-time formats.

461.6M3](/packages/kartik-v-php-date-formatter)[dater/dater

Compact PHP library for working with date/time in different formats &amp; timezones.

14484.2k](/packages/dater-dater)

PHPackages © 2026

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