PHPackages                             hereldar/date-times - 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. hereldar/date-times

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

hereldar/date-times
===================

Provides immutable classes for dates, times, time-zones and periods.

0.3.0(2y ago)26MITPHPPHP ^8.1.17|^8.2.4|^8.3.0CI passing

Since Jun 17Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/hereldar/php-date-times)[ Packagist](https://packagist.org/packages/hereldar/date-times)[ RSS](/packages/hereldar-date-times/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (6)Versions (5)Used By (0)

DateTimes
=========

[](#datetimes)

[![PHP](https://camo.githubusercontent.com/7685d4439202f3ed661d52ab4fd20e60907213cc2f9f35f22d64effda81aec9f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e31253230746f253230382e332d3737376262332e737667)](https://coveralls.io/github/hereldar/php-date-times)[![Code Coverage](https://camo.githubusercontent.com/3effa8a1a53f6d8fc0532633f2825e135041a470e2abd2efec6421a22231f2a4/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f686572656c6461722f7068702d646174652d74696d6573)](https://app.codecov.io/gh/hereldar/php-date-times)[![Type Coverage](https://camo.githubusercontent.com/4fcbb87c2e0b037ab550840f538bd9340510e000fb43260d53a7fdcf14e2fbb8/68747470733a2f2f73686570686572642e6465762f6769746875622f686572656c6461722f7068702d646174652d74696d65732f636f7665726167652e737667)](https://shepherd.dev/github/hereldar/php-date-times)[![Psalm Level](https://camo.githubusercontent.com/67a6f6c954123ef9008b7a127e0cbcc3d0eba07bf19339e7214d7fbababc7420/68747470733a2f2f73686570686572642e6465762f6769746875622f686572656c6461722f7068702d646174652d74696d65732f6c6576656c2e737667)](https://shepherd.dev/github/hereldar/php-date-times)[![Packagist](https://camo.githubusercontent.com/c3325f38a36f32b1e5e9044b25526d06f45528c2c83aac5c465223234fd98ce3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f686572656c6461722f646174652d74696d65732e737667)](https://packagist.org/packages/hereldar/date-times)[![License](https://camo.githubusercontent.com/074b89bca64d3edc93a1db6c7e3b1636b874540ba91d66367c0e5e354c56d0ea/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e737667)](LICENSE)

This library includes several classes representing the main date-time concepts, including dates, times, time-zones and periods.

```
LocalDate::now()->minus(weeks: 1)->atTime(LocalTime::noon())->toIso8601();
```

Highlights
----------

[](#highlights)

- Separation of concepts
- Immutability
- Type safety
- Cohesion

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

[](#installation)

Via Composer:

```
composer require hereldar/date-times
```

Development
-----------

[](#development)

Run the following commands from the project folder:

```
make tests
make static-analysis
make coding-standards
```

To execute:

- A [PHPUnit](https://phpunit.de) test suite.
- [PHPStan](https://phpstan.org/) and [Psalm](https://psalm.dev/) for static code analysis.
- [Easy Coding Standard](https://github.com/easy-coding-standard/easy-coding-standard)to fix coding standards.

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

[](#documentation)

- [Guide](https://hereldar.github.io/php-date-times/)
- [Reference](https://hereldar.github.io/php-date-times/reference/)

Credits
-------

[](#credits)

- [Samuel Maudo](https://github.com/samuelmaudo)

License
-------

[](#license)

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

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance40

Moderate activity, may be stable

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.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 ~136 days

Total

3

Last Release

789d ago

PHP version history (2 changes)0.1.0PHP ^8.1.17|^8.2.4

0.2.0PHP ^8.1.17|^8.2.4|^8.3.0

### Community

Maintainers

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

---

Top Contributors

[![samuelmaudo](https://avatars.githubusercontent.com/u/248153?v=4)](https://github.com/samuelmaudo "samuelmaudo (104 commits)")[![hereldar](https://avatars.githubusercontent.com/u/83026166?v=4)](https://github.com/hereldar "hereldar (2 commits)")

---

Tags

datetimetimedatedurationperiodiso8601iso-8601

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/hereldar-date-times/health.svg)

```
[![Health](https://phpackages.com/badges/hereldar-date-times/health.svg)](https://phpackages.com/packages/hereldar-date-times)
```

###  Alternatives

[brick/date-time

Date and time library

3623.3M61](/packages/brick-date-time)[league/period

Time range API for PHP

7335.4M21](/packages/league-period)[knplabs/knp-time-bundle

Making your dates and durations look sensible and descriptive

6308.9M39](/packages/knplabs-knp-time-bundle)[aeon-php/calendar

PHP type safe, immutable calendar library

2079.7M16](/packages/aeon-php-calendar)[tplaner/when

Date/Calendar recursion library.

5261.0M5](/packages/tplaner-when)[kartik-v/php-date-formatter

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

461.5M3](/packages/kartik-v-php-date-formatter)

PHPackages © 2026

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