PHPackages                             omitobisam/carbonate - 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. omitobisam/carbonate

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

omitobisam/carbonate
====================

Carbonate, more muscle to Carbon datetime wrapper

2.0.0(3y ago)237[1 issues](https://github.com/omitobi/carbonate/issues)MITPHPPHP &gt;=5.6.4CI failing

Since Jul 8Pushed 3y ago1 watchersCompare

[ Source](https://github.com/omitobi/carbonate)[ Packagist](https://packagist.org/packages/omitobisam/carbonate)[ Docs](https://omitobi.github.io/carbonate/)[ RSS](/packages/omitobisam-carbonate/feed)WikiDiscussions master Synced yesterday

READMEChangelog (7)Dependencies (3)Versions (11)Used By (0)

[![Build Status](https://camo.githubusercontent.com/707acf5817eb7379ddd5af56d3551d6e99ec5e6f7c343f7a9abd792a71744750/68747470733a2f2f7472617669732d63692e6f72672f6f6d69746f62692f636172626f6e6174652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/omitobi/carbonate)[![Latest Stable Version](https://camo.githubusercontent.com/e0f29e25297e5155b64f11ccb952c21e0daa5fb89ad56d95181a3b017938a808/68747470733a2f2f706f7365722e707567782e6f72672f6f6d69746f626973616d2f636172626f6e6174652f76657273696f6e)](https://packagist.org/packages/omitobisam/carbonate)[![Total Downloads](https://camo.githubusercontent.com/1c36843a7f0e21abfef61a3cf67f1c3c28129e237915c5bfff94391c919b1159/68747470733a2f2f706f7365722e707567782e6f72672f6f6d69746f626973616d2f636172626f6e6174652f646f776e6c6f616473)](https://packagist.org/packages/omitobisam/carbonate)[![Latest Unstable Version](https://camo.githubusercontent.com/3e3b671476de45b54586c929111e85b6b860335cd9490256b1a49acb0cf5ecf0/68747470733a2f2f706f7365722e707567782e6f72672f6f6d69746f626973616d2f636172626f6e6174652f762f756e737461626c65)](//packagist.org/packages/omitobisam/carbonate)[![Monthly Downloads](https://camo.githubusercontent.com/89f393d9151e694755e698fcc401ab0c5ddf90712aa369a35fc0229a9f20416f/68747470733a2f2f706f7365722e707567782e6f72672f6f6d69746f626973616d2f636172626f6e6174652f642f6d6f6e74686c79)](https://packagist.org/packages/omitobisam/carbonate)

Carbonate - a muscle to PHP Carbon with Collections
---------------------------------------------------

[](#carbonate---a-muscle-to-php-carbon-with-collections)

###### - dev-master or bleeding edge

[](#--dev-master-or-bleeding-edge)

#### Installation

[](#installation)

- `composer require omitobisam/carbonate`

If the above does not work then simply include the latest release version as in:

- `composer require omitobisam/carbonate ^0.2.1`

For the `dev-master` simply change the version to `dev-master`

Another option is to clone the dev-master branch and you can have the bleeding version

#### Requirements

[](#requirements)

Minimum: PHP 5.6.4

#### Usage:

[](#usage)

```
$mydate = new Carbonate('2017-09-01');
$enddate = new Carbonate('2017-10-30);

```

#### Get WeekendDates within two dates

[](#get-weekenddates-within-two-dates)

```
$result = $mydate->everyWeekendDays($enddate);

//
/*
* Result - A collection of dates in the weekend
*/
//

Illuminate\Support\Collection Object ( [items:protected] => Array (
[0] => Carbonate\Carbonate Object ( [date] => 2017-09-02 00:00:00.000000 [timezone_type] => 3 [timezone] => UTC )
[1] => Carbonate\Carbonate Object ( [date] => 2017-09-03 00:00:00.000000 [timezone_type] => 3 [timezone] => UTC )
[2] => Carbonate\Carbonate Object ( [date] => 2017-09-09 00:00:00.000000 [timezone_type] => 3 [timezone] => UTC )
.......
```

#### Collections method can be further used on the result e.g

[](#collections-method-can-be-further-used-on-the-result-eg)

```
// Verify if the last Carbon instance is actually weekend

$mydate->everyWeekendDays($enddate)->last()->isWeekend();
```

#### The result of the operations is shown as transformed from Carbon/Carbonate object to string using `stringify()`

[](#the-result-of-the-operations-is-shown-as-transformed-from-carboncarbonate-object-to-string-using-stringify)

```
Carbonate::stringify($mydate->everyWeekendDays($enddate));

//
/*
* Result - A collection of dates in the weekends as string
*/
//

Illuminate\Support\Collection Object ( [items:protected] => Array (
[0] => 2017-09-02 00:00:00
[1] => 2017-09-03 00:00:00
[2] => 2017-09-09 00:00:00
[3] => 2017-09-10 00:00:00
[4] => 2017-09-16 00:00:00
[5] => 2017-09-17 00:00:00
[6] => 2017-09-23 00:00:00
[7] => 2017-09-24 00:00:00
[8] => 2017-09-30 00:00:00
[9] => 2017-10-01 00:00:00
[10] => 2017-10-07 00:00:00
[11] => 2017-10-08 00:00:00
[12] => 2017-10-14 00:00:00
[13] => 2017-10-15 00:00:00
[14] => 2017-10-21 00:00:00
[15] => 2017-10-22 00:00:00
[16] => 2017-10-28 00:00:00
[17] => 2017-10-29 00:00:00 ) )
```

#### A string of dates can be converted whole into Carbonate/Carbon instances:

[](#a-string-of-dates-can-be-converted-whole-into-carbonatecarbon-instances)

```
Carbonate::carbonate(['today', 'tomorrow', '2017-10-30']);

Illuminate\Support\Collection Object ( [items:protected] => Array (
[0] => Carbonate\Carbonate Object ( [date] => 2017-10-21 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Berlin )
[1] => Carbonate\Carbonate Object ( [date] => 2017-10-22 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Berlin )
[2] => Carbonate\Carbonate Object ( [date] => 2017-10-30 00:00:00.000000 [timezone_type] => 3 [timezone] => Europe/Berlin ) ) )
```

#### Other methods

[](#other-methods)

```
$mydate->thisMonth();
$mydate->getDatesOfDaysInMonth(['Monday', 'Saturday']);
$mydate->everyWeekDays();
$mydate->everyDay('Monday');
$mydate->random(2);
$mydate->randomOne();
$mydate->anyMonday();
$mydate->anyTuesday();
$mydate->anyWednesday();
$mydate->anyThursday();
$mydate->anyFriday();
$mydate->anySaturday();
$mydate->anySunday();
$mydate->any();
$mydate->anyOne('Monday');
$mydate->stringify([Carbonate::now(), Carbonate::now()->addDay(1)]);
$mydate->carbonate(['today', 'tomorrow']);
$mydate->weekends(Carbonate::now()->addDay(7));
```

#### Info

[](#info)

Contributions
-------------

[](#contributions)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

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

Every ~235 days

Recently: every ~469 days

Total

9

Last Release

1352d ago

Major Versions

0.0.2 → 1.0.02018-06-01

1.1.0 → 2.0.02022-08-30

### Community

Maintainers

![](https://www.gravatar.com/avatar/364011bafbabff7b8c66b670b16ae372944dd4cc555531affffd901aae53d297?d=identicon)[omitobisam](/maintainers/omitobisam)

---

Top Contributors

[![omitobi](https://avatars.githubusercontent.com/u/16482234?v=4)](https://github.com/omitobi "omitobi (57 commits)")

---

Tags

timedatecollectioncarboncarbonate

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/omitobisam-carbonate/health.svg)

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

###  Alternatives

[league/period

Time range API for PHP

7335.4M21](/packages/league-period)[benhall14/php-calendar

A simple PHP class to generate calendars.

9822.6k](/packages/benhall14-php-calendar)[p3ym4n/jdate

Date converter from Jalali to Georgian and vice versa. It has Carbon instance inside and it's Laravel friendly.

101.8k2](/packages/p3ym4n-jdate)

PHPackages © 2026

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