PHPackages                             timdev/doctrine-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. [Database &amp; ORM](/categories/database)
4. /
5. timdev/doctrine-date-interval

ActiveLibrary[Database &amp; ORM](/categories/database)

timdev/doctrine-date-interval
=============================

Backported Doctrine DBAL DateIntervalType for use with DBAL &lt;2.6

v0.1.2(9y ago)06031MITPHPPHP &gt;=5.3.2

Since Apr 21Pushed 9y ago1 watchersCompare

[ Source](https://github.com/timdev/doctrine-date-interval)[ Packagist](https://packagist.org/packages/timdev/doctrine-date-interval)[ Docs](https://github.com/timdev/docrine-date-interval)[ RSS](/packages/timdev-doctrine-date-interval/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (4)Used By (1)

Doctrine DateInterval Type
==========================

[](#doctrine-dateinterval-type)

Doctrine DBAL 2.6 will introduce a DateInterval type which will map a PHP \\DateInterval to a column in the database. This will allow mapping DateInterval properties on your entities in the ORM.

At the time of this writing, 2.6 hasn't been released, but I need this for a project. So, this little project provides the type for use in 2.5 (and probably lower).

This is simply a copy/paste job of the DateIntervalType class from the upcoming DBAL 2.6, with a composer.json so it's easy to pull into a project using &lt;2.6.

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

[](#installation)

```
$ composer require timdev/doctrine-date-interval:0.1.2
```

Usage
-----

[](#usage)

Where ever you initialize your EntityManager:

```
\Doctrine\DBAL\Types\Type::addType('dateinterval', \TimDev\Doctrine\DBAL\Types\DateIntervalType::class);
$entityManager
    ->getConnection()
    ->getDatabasePlatform()
    ->registerDoctrineTypeMapping('dateinterval', 'dateinterval');
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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

Total

3

Last Release

3357d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4eb475c7f4d3d1df5053f83417bf4e756a35b59d1686cd7d379055da2828017f?d=identicon)[timdev](/maintainers/timdev)

---

Tags

doctrinedbaldateinterval

### Embed Badge

![Health badge](/badges/timdev-doctrine-date-interval/health.svg)

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

###  Alternatives

[fresh/doctrine-enum-bundle

Provides support of ENUM type for Doctrine2 in Symfony applications.

4627.0M12](/packages/fresh-doctrine-enum-bundle)[martin-georgiev/postgresql-for-doctrine

Extends Doctrine with native PostgreSQL support for arrays, JSONB, ranges, PostGIS geometries, text search, ltree, uuid, and 100+ PostgreSQL-specific functions.

4535.7M4](/packages/martin-georgiev-postgresql-for-doctrine)[jsor/doctrine-postgis

Spatial and Geographic Data with PostGIS and Doctrine.

2211.7M1](/packages/jsor-doctrine-postgis)[larapack/doctrine-support

Better Doctrine Support with Laravel (Support for `enum`)

1752.4M56](/packages/larapack-doctrine-support)[weirdan/doctrine-psalm-plugin

Stubs to let Psalm understand Doctrine better

877.2M58](/packages/weirdan-doctrine-psalm-plugin)[friendsofdoctrine/dbal-clickhouse

Doctrine DBAL driver for ClickHouse

1181.3M1](/packages/friendsofdoctrine-dbal-clickhouse)

PHPackages © 2026

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