PHPackages                             timacdonald/immutable-carbon - 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. timacdonald/immutable-carbon

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

timacdonald/immutable-carbon
============================

An attempt to make the Carbon date library immutable.

v1.0.0(8y ago)62.3k[2 PRs](https://github.com/timacdonald/immutable-carbon/pulls)MITPHPPHP &gt;=7.0

Since Nov 8Pushed 5y ago1 watchersCompare

[ Source](https://github.com/timacdonald/immutable-carbon)[ Packagist](https://packagist.org/packages/timacdonald/immutable-carbon)[ RSS](/packages/timacdonald-immutable-carbon/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (2)Versions (4)Used By (0)

Immutable Carbon
================

[](#immutable-carbon)

[![Latest Stable Version](https://camo.githubusercontent.com/d901a6489b95b24c5ef81f40787e8e11a906425eeb8dd1420771052c22b4b016/68747470733a2f2f706f7365722e707567782e6f72672f74696d6163646f6e616c642f696d6d757461626c652d636172626f6e2f762f737461626c65)](https://packagist.org/packages/timacdonald/immutable-carbon) [![Total Downloads](https://camo.githubusercontent.com/290afa43fff545cc1fac70b1dfe15933c6407a8f593f474adcfe01c80d108e87/68747470733a2f2f706f7365722e707567782e6f72672f74696d6163646f6e616c642f696d6d757461626c652d636172626f6e2f646f776e6c6f616473)](https://packagist.org/packages/timacdonald/immutable-carbon) [![License](https://camo.githubusercontent.com/71fa9260a4176323a83ad97e8ca329786b8d68cec552c0417f1c576c4a0f1a63/68747470733a2f2f706f7365722e707567782e6f72672f74696d6163646f6e616c642f696d6d757461626c652d636172626f6e2f6c6963656e7365)](https://packagist.org/packages/timacdonald/immutable-carbon)

[Carbon](https://github.com/briannesbitt/Carbon) is awesome. Immutable carbon is just a little bit more awesome. An attempt to make the Carbon date library immutable. It is simply a wrapper class around the `Carbon\Carbon` class so you can just use it as if you were using the actual class. Just keep in mind that it is immutable - thus you can no longer set values by calling `$instance->property = 'whatever'`.

This was a hobby project to attempt to make Carbon immutable - but you should probably check out [Chronos](https://github.com/cakephp/chronos) for any large project.

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

[](#installation)

You can install using [composer](https://getcomposer.org/) from [Packagist](https://packagist.org/packages/timacdonald/immutable-carbon)

```
composer require timacdonald/immutable-carbon

```

Versioning
----------

[](#versioning)

This package uses *Semantic Versioning*. You can find out more about what this is and why it matters by reading [the spec](http://semver.org) or for something more readable, check out [this post](https://laravel-news.com/building-apps-composer).

Basic Usage
-----------

[](#basic-usage)

Here is a quick example. You'll noticed the API is the same as the base library.

```
$now = Carbon::now();

$tomorrow = $now->addDay();
```

Once this code has run `$now` is still todays date, i.e. `$now == Carbon::now()`, however `$tomorrow == Carbon::now()->addDay()`.

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

[](#contributing)

Please feel free to suggest new ideas or send through pull requests to make this better. If you'd like to discuss the project, feel free to reach out on [Twitter](https://twitter.com/timacdonald87). I just throw my ideas for the project in the [issues list](https://github.com/timacdonald/immutable-carbon/issues) if you want to help implement anything.

License
-------

[](#license)

This package is under the MIT License. See [LICENSE](https://github.com/timacdonald/immutable-carbon/blob/master/LICENSE) file for details.

Thanks
------

[](#thanks)

Big thanks to everyone who has contributed to the Carbon date library and [Freek Van der Herten](https://twitter.com/freekmurze) for [inspiring](https://twitter.com/freekmurze/status/927985661818400768) me to give this a go.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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

Unknown

Total

1

Last Release

3110d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/407c551b36817af2c26c7719fa6a16b8767ed7096d2930bf8e001237727ba847?d=identicon)[timacdonald](/maintainers/timacdonald)

---

Top Contributors

[![timacdonald](https://avatars.githubusercontent.com/u/24803032?v=4)](https://github.com/timacdonald "timacdonald (7 commits)")

---

Tags

datetimetimedateimmutable

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/timacdonald-immutable-carbon/health.svg)

```
[![Health](https://phpackages.com/badges/timacdonald-immutable-carbon/health.svg)](https://phpackages.com/packages/timacdonald-immutable-carbon)
```

###  Alternatives

[aeon-php/calendar

PHP type safe, immutable calendar library

2079.7M16](/packages/aeon-php-calendar)[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)[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)[dater/dater

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

14282.3k](/packages/dater-dater)

PHPackages © 2026

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