PHPackages                             bakame/period - 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. bakame/period

Abandoned → [league/period](/?search=league%2Fperiod)Library[Utility &amp; Helpers](/categories/utility)

bakame/period
=============

Time range API for PHP

5.3.3(7mo ago)7344345MITPHPPHP ^8.1CI failing

Since Sep 19Pushed 4w ago15 watchersCompare

[ Source](https://github.com/thephpleague/period)[ Packagist](https://packagist.org/packages/bakame/period)[ Docs](http://period.thephpleague.com)[ GitHub Sponsors](https://github.com/sponsors/nyamsprod)[ RSS](/packages/bakame-period/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (7)Versions (48)Used By (0)

Period
======

[](#period)

[![Author](https://camo.githubusercontent.com/8227017ba73e8c0c93fa2c9c653cf702644a5af5d422e7f612b31d45efc180a1/687474703a2f2f696d672e736869656c64732e696f2f62616467652f617574686f722d406e79616d7370726f642d626c75652e7376673f7374796c653d666c61742d737175617265)](https://twitter.com/nyamsprod)[![Latest Version](https://camo.githubusercontent.com/78065436736a9a2a6e5efe01b8b58480d250fa5cc3e4077ac6f04c17c11d210f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f7468657068706c65616775652f706572696f642e7376673f7374796c653d666c61742d737175617265)](https://github.com/thephpleague/period/releases)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Build](https://github.com/thephpleague/period/workflows/build/badge.svg)](https://github.com/thephpleague/period/actions?query=workflow%3A%22build%22)[![Total Downloads](https://camo.githubusercontent.com/853957cbf46af0b3cb5f2414dfd2e7f30eb34369c3da2d35f299a32df3f170e0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c65616775652f706572696f642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/league/period)

`Period` is PHP's missing time range API. This package covers all basic operations regarding time ranges.

Highlights
----------

[](#highlights)

- Represents Interval and Bounds as immutable value objects or enumeration
- Exposes named constructors to ease instantiation
- Covers all basic manipulations related to time range
- Enables working with simple or complex time ranges logic
- Fully documented
- Framework-agnostic

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

[](#documentation)

Full documentation can be found at [period.thephpleague.com](http://period.thephpleague.com).

System Requirements
-------------------

[](#system-requirements)

You need **PHP &gt;= 8.1.0** but the latest stable version of PHP is recommended.

Install
-------

[](#install)

Install `Period` using Composer.

```
$ composer require league/period

```

or download the library and:

- use any other [PSR-4](http://www.php-fig.org/psr/psr-4/) compatible autoloader.
- use the bundle autoloader script as shown below:

```
require 'path/to/period/repo/autoload.php';

use League\Period\Datepoint;

Datepoint::fromDateString('2012-05-23')->month()->toIso80000('Y-m-d');
//returns [2012-05-01, 2012-06-01)
```

where `path/to/period/repo` represents the path where the library was extracted.

Testing
-------

[](#testing)

`Period` has:

- a [PHPUnit](https://phpunit.de) test suite
- a code analysis compliance test suite using [PHPStan](https://github.com/phpstan/phpstan).
- a coding style compliance test suite using [PHP CS Fixer](http://cs.sensiolabs.org/).

To run the tests, run the following command from the project folder.

```
$ composer test
```

Contributing
------------

[](#contributing)

Contributions are welcome and will be fully credited. Please see [CONTRIBUTING](.github/CONTRIBUTING.md) and [CONDUCT](.github/CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Ignace Nyamagana Butera](https://github.com/nyamsprod)
- [All Contributors](https://github.com/thephpleague/period/graphs/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

###  Health Score

59

—

FairBetter than 99% of packages

Maintenance81

Actively maintained with recent releases

Popularity31

Limited adoption so far

Community29

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 94.1% 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 ~89 days

Recently: every ~241 days

Total

46

Last Release

213d ago

Major Versions

0.3.0 → 1.0.02014-09-24

1.0.1 → 2.0.02014-10-15

2.5.1 → 3.0.02015-09-02

3.4.0 → 4.0.02018-10-18

4.x-dev → 5.0.02022-02-22

PHP version history (9 changes)0.1.0PHP &gt;=5.3.0

2.5.0PHP &gt;=5.4.0

3.0.0PHP &gt;=5.5.0

3.1.0PHP &gt;=5.5.9

4.0.0PHP &gt;=7.1.3

4.3.1PHP ^7.1.3

4.10.0PHP ^7.2.0

4.11.0PHP ^7.2.0 || ^8.0

5.0.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/51073?v=4)[Ignace Nyamagana Butera](/maintainers/nyamsprod)[@nyamsprod](https://github.com/nyamsprod)

---

Top Contributors

[![nyamsprod](https://avatars.githubusercontent.com/u/51073?v=4)](https://github.com/nyamsprod "nyamsprod (843 commits)")[![Bibendus83](https://avatars.githubusercontent.com/u/4517370?v=4)](https://github.com/Bibendus83 "Bibendus83 (22 commits)")[![maogou](https://avatars.githubusercontent.com/u/48229139?v=4)](https://github.com/maogou "maogou (3 commits)")[![philsturgeon](https://avatars.githubusercontent.com/u/67381?v=4)](https://github.com/philsturgeon "philsturgeon (2 commits)")[![ntzm](https://avatars.githubusercontent.com/u/3888578?v=4)](https://github.com/ntzm "ntzm (2 commits)")[![Rarst](https://avatars.githubusercontent.com/u/737584?v=4)](https://github.com/Rarst "Rarst (2 commits)")[![rdohms](https://avatars.githubusercontent.com/u/94331?v=4)](https://github.com/rdohms "rdohms (2 commits)")[![kraftner](https://avatars.githubusercontent.com/u/2428517?v=4)](https://github.com/kraftner "kraftner (2 commits)")[![dritter](https://avatars.githubusercontent.com/u/1544760?v=4)](https://github.com/dritter "dritter (2 commits)")[![Jamesking56](https://avatars.githubusercontent.com/u/253237?v=4)](https://github.com/Jamesking56 "Jamesking56 (1 commits)")[![jeromegamez](https://avatars.githubusercontent.com/u/67554?v=4)](https://github.com/jeromegamez "jeromegamez (1 commits)")[![kekenec](https://avatars.githubusercontent.com/u/11806874?v=4)](https://github.com/kekenec "kekenec (1 commits)")[![notFloran](https://avatars.githubusercontent.com/u/523981?v=4)](https://github.com/notFloran "notFloran (1 commits)")[![pryazhnikov](https://avatars.githubusercontent.com/u/154469?v=4)](https://github.com/pryazhnikov "pryazhnikov (1 commits)")[![svenluijten](https://avatars.githubusercontent.com/u/11269635?v=4)](https://github.com/svenluijten "svenluijten (1 commits)")[![adamnicholson](https://avatars.githubusercontent.com/u/7761178?v=4)](https://github.com/adamnicholson "adamnicholson (1 commits)")[![willtj](https://avatars.githubusercontent.com/u/465569?v=4)](https://github.com/willtj "willtj (1 commits)")[![bcrowe](https://avatars.githubusercontent.com/u/752603?v=4)](https://github.com/bcrowe "bcrowe (1 commits)")[![ben-synapse](https://avatars.githubusercontent.com/u/36077477?v=4)](https://github.com/ben-synapse "ben-synapse (1 commits)")[![bpolaszek](https://avatars.githubusercontent.com/u/5569077?v=4)](https://github.com/bpolaszek "bpolaszek (1 commits)")

---

Tags

calendarcollectiondatedaterangedatetimeintervalperiodphprangesequencetimetimelinevalue-objectdatetimetimedateschedulecollectioncalendartimelineintervaldateintervalrangeperiodsequencedateperiodunionsboundariesgapintersections

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/bakame-period/health.svg)

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

###  Alternatives

[league/period

Time range API for PHP

7335.4M21](/packages/league-period)[brick/date-time

Date and time library

3623.3M61](/packages/brick-date-time)[aeon-php/calendar

PHP type safe, immutable calendar library

2079.7M16](/packages/aeon-php-calendar)[alroniks/dtms

Classes for manipulate dates and intervals with microseconds precision

187.5k](/packages/alroniks-dtms)

PHPackages © 2026

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