PHPackages                             comsolit/date-time-immutable - 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. comsolit/date-time-immutable

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

comsolit/date-time-immutable
============================

Polyfill for the DateTimeImmutable class added in PHP 5.5.0

v2.0.0+alpha1(11y ago)042MITPHPPHP &gt;=5.4.0

Since Nov 11Pushed 11y ago7 watchersCompare

[ Source](https://github.com/comsolit/date-time-immutable)[ Packagist](https://packagist.org/packages/comsolit/date-time-immutable)[ Docs](https://github.com/comsolit/date-time-immutable)[ RSS](/packages/comsolit-date-time-immutable/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

`DateTimeImmutable` polyfill
============================

[](#datetimeimmutable-polyfill)

[![Build Status](https://camo.githubusercontent.com/0aa540b0abd14f94463773d2445fe544698da5a61f787549255e12f986013938/68747470733a2f2f7472617669732d63692e6f72672f74686577696c6b796261726b69642f646174652d74696d652d696d6d757461626c652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/thewilkybarkid/date-time-immutable)

This small library adds a polyfill for the `DateTimeImmutable` object introduced in PHP 5.5.0.

Authors
-------

[](#authors)

- Chris Wilkinson

It's partially based on Benjamin Eberlei's [Immutable DateTime Objects](http://www.whitewashing.de/2010/01/08/immutable-datetime-objects.html) blog post.

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

[](#installation)

```
$ php composer.phar require thewilkybarkid/date-time-immutable:~1.0

```

Basic usage
-----------

[](#basic-usage)

```
$dateTime = new DateTimeImmutable();
$newDateTime = $datetime->modify('+1 day');
var_dump($dateTime === $newDateTime); // output 'bool(false)'

```

Caveats
-------

[](#caveats)

PHP 5.5.0 also introduced a `DateTimeInterface` which both `DateTimeImmutable` and `DateTime` implement. In this polyfill we can't change the `DateTime` class, so `DateTimeImmutable` has to extend it. This is slightly dangerous as their behaviour is not compatible (see ).

PHP 5.6.0 added a `DateTimeImmutable::createFromMutable()` factory method, which this polyfill doesn't include.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~164 days

Total

4

Last Release

4078d ago

Major Versions

v1.0.2 → v2.0.0+alpha12015-03-19

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

v2.0.0+alpha1PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/330bd5b6615b47b79b7a91898ac6b588b3c055e999c5fa10ee6037a9d801c9c1?d=identicon)[comsolit](/maintainers/comsolit)

---

Top Contributors

[![thewilkybarkid](https://avatars.githubusercontent.com/u/1784740?v=4)](https://github.com/thewilkybarkid "thewilkybarkid (21 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/comsolit-date-time-immutable/health.svg)

```
[![Health](https://phpackages.com/badges/comsolit-date-time-immutable/health.svg)](https://phpackages.com/packages/comsolit-date-time-immutable)
```

###  Alternatives

[zepgram/module-multi-threading

This module is a powerful tool for developers who want to process large data sets in a short amount of time

8122.2k](/packages/zepgram-module-multi-threading)

PHPackages © 2026

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