PHPackages                             cherrypick/hammertime - 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. cherrypick/hammertime

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

cherrypick/hammertime
=====================

Some extensions to Carbon (a DateTime class)

v0.4.1(6y ago)322.5k2MITPHP

Since Dec 17Pushed 6y ago2 watchersCompare

[ Source](https://github.com/cherrypick/HammerTime)[ Packagist](https://packagist.org/packages/cherrypick/hammertime)[ RSS](/packages/cherrypick-hammertime/feed)WikiDiscussions master Synced 1mo ago

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

Alright stop … HammerTime!
==========================

[](#alright-stop--hammertime)

[![MC Hammer having a Hammer time](https://camo.githubusercontent.com/6248f79ed9b83079bdae5be98b6b30a8c91127d547a932bfae006d76ed2796b6/687474703a2f2f6d65646961322e67697068792e636f6d2f6d656469612f6b674b724f3141334a6257544b2f67697068792e676966)](https://camo.githubusercontent.com/6248f79ed9b83079bdae5be98b6b30a8c91127d547a932bfae006d76ed2796b6/687474703a2f2f6d65646961322e67697068792e636f6d2f6d656469612f6b674b724f3141334a6257544b2f67697068792e676966)

This date library extends [Carbon](https://github.com/briannesbitt/Carbon) with some more sophisticated date calculations and getters / setters for all date parts.

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

[](#installation)

Install using composer:

```
composer require cherrypick/hammertime

```

Features
--------

[](#features)

### More sophisticated date calculations

[](#more-sophisticated-date-calculations)

The date calculations with HammerTime are closer to real world problems. When you are at the end of a month and add another month, it doesn't leap into the beginning of the month afterwards.

```
$date = HammerTime::createFromDate(2014, 5, 31);
$date->addMonths(1); // 2014-06-30 (with default PHP DateTime (and Carbon) it would be 2014-07-01)

$date = HammerTime::createFromDate(2012, 2, 29);
$date->addYear(1); // 2013-02-28 (with default PHP DateTime (and Carbon) it would be 2013-03-01)
```

Similar, it applies to the diff of months. You can find more information and examples [here.](http://php.net/manual/de/datetime.diff.php#101990)

```
$date1 = HammerTime::createFromDate(2014, 2, 1);
$date2 = HammerTime::createFromDate(2014, 3, 1);

$date1->diffInMonths($date2); // 1 (with default PHP DateTime (and Carbon) it would be 0)
```

### Date Comparisons

[](#date-comparisons)

This library provides some more clear names for date comparisons.

```
$date1->isSameDate($date2);
$date1->isBefore($date2);
$date1->isBeforeOrEqual($date2);
$date1->isAfter($date2);
$date1->isAfterOrEqual($date2);
```

### Getters and Setters

[](#getters-and-setters)

This library provides getters and setters for all available date information:

```
$date = HammerTime::createFromDate(2014, 11, 30, 12, 42, 42);
$date->getDay(); // 30
$date->getMonth(); // 11
$date->getYear(); // 2014
$date->getHour(); // 12
$date->getMinute(); // 42
$date->getSecond(); // 42
// and many more...

// the same applies to setters.
$date->setDay(20); // 2014-11-20
// etc..
```

There are Getters and Setters for every availble property.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~359 days

Recently: every ~415 days

Total

6

Last Release

2375d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/71cd933b37f7c5ca10b7e36e8c16922773fe15764ba7f2cc53f278e272d24bff?d=identicon)[digilist](/maintainers/digilist)

---

Top Contributors

[![digilist](https://avatars.githubusercontent.com/u/833667?v=4)](https://github.com/digilist "digilist (14 commits)")[![ksm2](https://avatars.githubusercontent.com/u/1469675?v=4)](https://github.com/ksm2 "ksm2 (4 commits)")[![endelwar](https://avatars.githubusercontent.com/u/28512?v=4)](https://github.com/endelwar "endelwar (3 commits)")

### Embed Badge

![Health badge](/badges/cherrypick-hammertime/health.svg)

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

###  Alternatives

[ashallendesign/short-url

A Laravel package for creating shortened URLs for your web apps.

1.4k1.9M4](/packages/ashallendesign-short-url)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

52664.9k12](/packages/solspace-craft-freeform)[intervention/zodiac

Zodiac Sign Calculator

58191.7k](/packages/intervention-zodiac)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)[solspace/craft-calendar

The most powerful event management and calendaring plugin!

1830.8k1](/packages/solspace-craft-calendar)

PHPackages © 2026

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