PHPackages                             pedhot-dev/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. pedhot-dev/carbon

ActiveLibrary

pedhot-dev/carbon
=================

A simple API extension for DateTime.

03PHP

Since Apr 24Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Pedhot-Dev/Carbon)[ Packagist](https://packagist.org/packages/pedhot-dev/carbon)[ RSS](/packages/pedhot-dev-carbon/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Carbon
======

[](#carbon)

[![Latest Stable Version](https://camo.githubusercontent.com/ccb0052e49ee9f020df907533c80b5bc753265f1a9fc3f3c40109a51fef70dde/68747470733a2f2f706f7365722e707567782e6f72672f6e6573626f742f636172626f6e2f762f737461626c652e706e67)](https://packagist.org/packages/nesbot/carbon) [![Total Downloads](https://camo.githubusercontent.com/7f4f01c66e8ce309d10e904e6adeb3403e5f0e267c156f82aa3109edfaed6062/68747470733a2f2f706f7365722e707567782e6f72672f6e6573626f742f636172626f6e2f646f776e6c6f6164732e706e67)](https://packagist.org/packages/nesbot/carbon) [![Build Status](https://camo.githubusercontent.com/ee24915c5e36c96a5d303e1ffcbf2771a06992ec6416b77a46021b0eba8e7c27/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f627269616e6e6573626974742f436172626f6e2e706e67)](http://travis-ci.org/briannesbitt/Carbon)

A simple PHP API extension for DateTime.

```
printf("Right now is %s", Carbon::now()->toDateTimeString());
printf("Right now in Vancouver is %s", Carbon::now('America/Vancouver'));  //implicit __toString()
$tomorrow = Carbon::now()->addDay();
$lastWeek = Carbon::now()->subWeek();
$nextSummerOlympics = Carbon::createFromDate(2012)->addYears(4);

$officialDate = Carbon::now()->toRfc2822String();

$howOldAmI = Carbon::createFromDate(1975, 5, 21)->age;

$noonTodayLondonTime = Carbon::createFromTime(12, 0, 0, 'Europe/London');

$worldWillEnd = Carbon::createFromDate(2012, 12, 21, 'GMT');

// Don't really want to die so mock now
Carbon::setTestNow(Carbon::createFromDate(2000, 1, 1));

// comparisons are always done in UTC
if (Carbon::now()->gte($worldWillEnd)) {
   die();
}

// Phew! Return to normal behaviour
Carbon::setTestNow();

if (Carbon::now()->isWeekend()) {
   echo 'Party!';
}
echo Carbon::now()->subMinutes(2)->diffForHumans(); // '2 minutes ago'

// ... but also does 'from now', 'after' and 'before'
// rolling up to seconds, minutes, hours, days, months, years

$daysSinceEpoch = Carbon::createFromTimeStamp(0)->diffInDays();
```

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 Bus Factor1

Top contributor holds 66.7% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2605cface9339b0534b6be9f1bff3082e5608e44dc0969725a58309536ab496a?d=identicon)[AgusPedhot](/maintainers/AgusPedhot)

---

Top Contributors

[![poggit-bot](https://avatars.githubusercontent.com/u/22427965?v=4)](https://github.com/poggit-bot "poggit-bot (2 commits)")[![Pedhot-Dev](https://avatars.githubusercontent.com/u/70968506?v=4)](https://github.com/Pedhot-Dev "Pedhot-Dev (1 commits)")

### Embed Badge

![Health badge](/badges/pedhot-dev-carbon/health.svg)

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

PHPackages © 2026

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