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

AbandonedLibrary

tubssz/date-interval
====================

Provides additional functionality to the DateInterval class.

1.3.4(10y ago)01.7k1MITPHPPHP &gt;=5.3|~7.0

Since Feb 8Pushed 10y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (1)Versions (9)Used By (1)

DateInterval
============

[](#dateinterval)

[![Build Status](https://camo.githubusercontent.com/b4b2f1702b76c415a5905e1e124c60575450970e9aa73978c2bf48188b86c534/68747470733a2f2f7472617669732d63692e6f72672f74756273737a2f7068702d646174652d696e74657276616c2e706e67)](http://travis-ci.org/tubssz/php-date-interval)

Provides additional functionality to the DateInterval class.

Summary
-------

[](#summary)

The `DateInterval` class builds on the existing `DateInterval` class provided by PHP. With the new class, you may

- convert `DateInterval` to the [interval spec](http://php.net/manual/en/dateinterval.construct.php)
- convert `DateInterval` to the number of seconds
    - convert back to `DateInterval` from the number of seconds

> The conversion to seconds requires [a bit of explaining](https://github.com/herrera-io/php-date-interval/wiki/API#wiki-toSeconds).

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

[](#installation)

Add it to your list of Composer dependencies:

```
$ composer require tubssz/date-interval=1.*
```

Usage
-----

[](#usage)

```
