PHPackages                             warmans/date-range - 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. warmans/date-range

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

warmans/date-range
==================

Small utility class used to create date range arrays.

0.0.3(11y ago)03.5kPHP

Since Sep 2Pushed 11y ago1 watchersCompare

[ Source](https://github.com/warmans/date-range)[ Packagist](https://packagist.org/packages/warmans/date-range)[ RSS](/packages/warmans-date-range/feed)WikiDiscussions master Synced 1w ago

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

Date Range
==========

[](#date-range)

[![Build Status](https://camo.githubusercontent.com/58c50e37d65a1caadc1a05275d75869e79ab07c54893c5f734eedf1720d767c8/68747470733a2f2f7472617669732d63692e6f72672f7761726d616e732f646174652d72616e67652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/warmans/date-range)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/46f6b82579905ab7b0d40fd9a1722b18730bdbe7c87bb0ec39558b3e13c2264e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7761726d616e732f646174652d72616e67652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/warmans/date-range/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/ffcafa59aabbcfe3571621cd0231b456005f1763fcc844c81f29ed7dc7a02e32/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7761726d616e732f646174652d72616e67652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/warmans/date-range/?branch=master)

Relative
--------

[](#relative)

Thin wrapper around DateTime classes to simplify generating date ranges relative to the current date.

### Basic Usage

[](#basic-usage)

Create a range instance specifying its options:

```
$range = new \DateRange\Relative(array('length'=>'60 DAY', 'interval'=>'P1D');

```

Export the specified range as an array:

```
var_dump($range->getRange());

```

It will look something like this:

```
array(
    '01-01-2014' => array('raw' => \DateTime, 'formatted' => '01-01-2014')
    '02-01-2014' => array('raw' => \DateTime, 'formatted' => '02-01-2014')
    //etc...
)

```

### Options

[](#options)

OptionExampleDescriptionlength30 DAYSDateTime format relative date stringmodify-1 DAYOffset the date range by this DateTime format relative date stringintervalP1DDateInterval format intervaldate\_formatY-m-ddate() style date format for result

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity55

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

Total

3

Last Release

4239d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1299401?v=4)[SW](/maintainers/warmans)[@warmans](https://github.com/warmans)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/warmans-date-range/health.svg)

```
[![Health](https://phpackages.com/badges/warmans-date-range/health.svg)](https://phpackages.com/packages/warmans-date-range)
```

###  Alternatives

[fragkp/laravel-route-breadcrumb

7011.7k](/packages/fragkp-laravel-route-breadcrumb)

PHPackages © 2026

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