PHPackages                             permafrost-dev/expanded-dates - 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. permafrost-dev/expanded-dates

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

permafrost-dev/expanded-dates
=============================

Expands a date from a single format to multiple formats

1.0.3(6y ago)02MITPHPPHP ^7.1CI failing

Since Aug 1Pushed 6y ago1 watchersCompare

[ Source](https://github.com/permafrost-dev/expanded-dates)[ Packagist](https://packagist.org/packages/permafrost-dev/expanded-dates)[ Docs](https://github.com/permafrost-dev/expanded-dates)[ RSS](/packages/permafrost-dev-expanded-dates/feed)WikiDiscussions master Synced 6d ago

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

Expanded Dates
==============

[](#expanded-dates)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ac0b2b6ce525ee21707aba762be8bd24041259679a32a53b418d6c6a1cdfc584/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7065726d6166726f73742d6465762f657870616e6465642d7061636b616765732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/permafrost-dev/expanded-packages)[![Build Status](https://camo.githubusercontent.com/c98af6760ae8d217a728a409d2475ef78d2fa97cc524c579151e1dfa44ee346b/68747470733a2f2f7472617669732d63692e6f72672f7065726d6166726f73742d6465762f657870616e6465642d64617465732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/permafrost-dev/expanded-packages)[![Quality Score](https://camo.githubusercontent.com/8c9b440a7a00941181ad75776824e4b8293c4f06db58ca00330bd2545d273bb2/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7065726d6166726f73742d6465762f657870616e6465642d7061636b616765732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/permafrost-dev/expanded-packages)[![Total Downloads](https://camo.githubusercontent.com/6adc513ac71a26b60c180557644411a96ab8a0395e9f5ccc6a945601bbbaa772/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7065726d6166726f73742d6465762f657870616e6465642d7061636b616765732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/permafrost-dev/expanded-packages)

This package takes an input string of a date (or a Carbon instance,) and expands it into an object containing several common formats, such as relative time and age in seconds, minutes, days, etc. See below for an example.

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

[](#installation)

You can install the package via composer:

```
composer require permafrost-dev/expanded-dates
```

Usage
-----

[](#usage)

```
    include __DIR__.'/../vendor/autoload.php';
    $dateOne = ExpandedDate::create(Carbon::now()->subSeconds(35));
    print_r($ed1);
```

Expands to an ExpandedDate object:

```
Permafrost\ExpandedDates\ExpandedDate Object
(
    [value] => 2019-08-09T19:43:10-04:00
    [relative] => 35 seconds ago
    [formatted] => Aug 9, 2019
    [time] => 7:43 PM
    [timestamp] => 1565394190
    [day] => Friday
    [age] => stdClass Object
        (
            [seconds] => 35
            [minutes] => 0
            [hours] => 0
            [days] => 0
            [weeks] => 0
        )

)

```

### Testing

[](#testing)

```
composer test
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

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 ~3 days

Total

4

Last Release

2473d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/de8dcb8e8a47ddc1076a26721d1ce7b17e3066b53c4a5c5e9aa31367c1955a20?d=identicon)[permafrost-dev](/maintainers/permafrost-dev)

---

Tags

date-formatterdatesrelative-daterelative-timedatespermafrost

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/permafrost-dev-expanded-dates/health.svg)

```
[![Health](https://phpackages.com/badges/permafrost-dev-expanded-dates/health.svg)](https://phpackages.com/packages/permafrost-dev-expanded-dates)
```

###  Alternatives

[simshaun/recurr

PHP library for working with recurrence rules

1.6k15.7M40](/packages/simshaun-recurr)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)[jpmurray/laravel-countdown

Provide an easy class easy way to get the time difference between two dates, with an extra bonus trait for eloquent

833.8k](/packages/jpmurray-laravel-countdown)[permafrost-dev/code-snippets

Easily work with code snippets in PHP

14403.5k2](/packages/permafrost-dev-code-snippets)[wilianx7/php-recurring

PHP library to make getting dates easier when working with recurring tasks.

1045.0k](/packages/wilianx7-php-recurring)

PHPackages © 2026

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