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

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

robier/date
===========

Simple date implementation of ISO 8601 standard

v1.1.0(8y ago)12481MITPHPPHP ^7.1

Since Jul 31Pushed 8y ago1 watchersCompare

[ Source](https://github.com/robier/date)[ Packagist](https://packagist.org/packages/robier/date)[ Docs](https://github.com/robier/date)[ RSS](/packages/robier-date/feed)WikiDiscussions master Synced 2mo ago

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

Date
====

[](#date)

Simple date implementation of ISO 8601 standard.

[![Build Status](https://camo.githubusercontent.com/733f3d1ec75978efc28de64e02912931aa76e885c24257dfd79de33df86414d9/68747470733a2f2f7472617669732d63692e6f72672f726f626965722f646174652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/robier/date)[![Test Coverage](https://camo.githubusercontent.com/8312d570929784f7aaf699624216e0a8684349a1e69c6baa6f46c5e963017f9c/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f726f626965722f646174652f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/robier/date/coverage)

### Introduction

[](#introduction)

The Date class follows the [ISO 8601](http://en.wikipedia.org/wiki/ISO_8601) standard for representing date.

Also allows easy getting range of two dates.

### Installation

[](#installation)

You can install this library with composer.

```
composer require robier/date
```

### Requirements

[](#requirements)

This library requires PHP 7.1.

### Overview

[](#overview)

This library contains of 3 classes:

- `Date` - representation of actual date
- `Date\Factory` - factory for creating `Date` object in different ways
- `Date\Range` - generator that represents range between 2 dates

### Samples

[](#samples)

Creating new instance of Date (various ways how to get date 1991-11-14):

```
use Robier\Date;

$date = new Date(1991, 11, 14); // or
$date = Date/Factory::new(1991, 11, 14); // or
$date = Date/Factory::dateTime(DateTime::createFromFormat('Y-m-d', '1991-11-14')); // or
$date = Date/Factory::string('1991-11-14'); // or
$date = Date/Factory::iso(1991, 46, 4);
```

---

Get today date:

```
$today = Date/Factory::today();
```

---

Get tomorrows date:

```
$tomorrow = Date/Factory::tomorrow(); // or
$tomorrow = Date/Factory::today()->next();
```

---

Get yesterday date:

```
$yesterday = Date/Factory::yesterday(); // or
$yesterday = Date/Factory::today()->previous();
```

---

Get any date in future of provided date (ie. 5 days after 1991-11-14):

```
$date = new Date(1991, 11, 14);
$date->next(5);
```

---

Get any date in past of provided date (ie. 6 days before 1991-11-14):

```
$date = new Date(1991, 11, 14);
$date->previous(6);
```

---

Range between 2 dates (ie. get dates between 1991-11-14 and 1991-12-01):

```
$start = new Date(1991, 11, 14);
$end = new Date(1991, 12, 1);

$range = new Date\Range($start, $end); // or
$range = $start->to($end);
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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

Total

2

Last Release

3203d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3607521?v=4)[Robert](/maintainers/robier)[@robier](https://github.com/robier)

---

Top Contributors

[![robier](https://avatars.githubusercontent.com/u/3607521?v=4)](https://github.com/robier "robier (5 commits)")

---

Tags

dateiso8601php

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[raiym/instagram-php-scraper

Instagram PHP Scraper. Get account information, photos and videos without any authorization

3.3k1.2M6](/packages/raiym-instagram-php-scraper)[devster/ubench

Micro PHP library for benchmarking

5701.0M29](/packages/devster-ubench)[msp/devtools

222629.1k2](/packages/msp-devtools)[eusonlito/laravel-meta

A package to manage Header Meta Tags

196525.1k2](/packages/eusonlito-laravel-meta)[geniusts/hijri-dates

PHP library to convert Gregorian date to Hijri date and vice versa

104334.3k9](/packages/geniusts-hijri-dates)[discoverydesign/filament-gaze

See who's viewing a resource in Filament PHP.

17473.7k](/packages/discoverydesign-filament-gaze)

PHPackages © 2026

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