PHPackages                             sllh/doctrine-dbal-utc-datetime - 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. sllh/doctrine-dbal-utc-datetime

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

sllh/doctrine-dbal-utc-datetime
===============================

UTC DateTime type for Doctrine DBAL

v1.0.0(8y ago)1137.0k↓50%3MITPHPPHP ^7.1

Since Sep 25Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Soullivaneuh/doctrine-dbal-utc-datetime)[ Packagist](https://packagist.org/packages/sllh/doctrine-dbal-utc-datetime)[ RSS](/packages/sllh-doctrine-dbal-utc-datetime/feed)WikiDiscussions master Synced 1mo ago

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

Doctrine DBAL UTC DateTime
==========================

[](#doctrine-dbal-utc-datetime)

UTC DateTime type for Doctrine DBAL.

[![Latest Stable Version](https://camo.githubusercontent.com/ff1808ad2be34bc092bbff8b487911e5d861b7ce7c7a9896a349b25809c9c808/68747470733a2f2f706f7365722e707567782e6f72672f736c6c682f646f637472696e652d6462616c2d7574632d6461746574696d652f762f737461626c65)](https://packagist.org/packages/sllh/doctrine-dbal-utc-datetime)[![Latest Unstable Version](https://camo.githubusercontent.com/2a388e0519f94c1f09ab83292d435a84da479b673d3397685f4b95675f82a01a/68747470733a2f2f706f7365722e707567782e6f72672f736c6c682f646f637472696e652d6462616c2d7574632d6461746574696d652f762f756e737461626c65)](https://packagist.org/packages/sllh/doctrine-dbal-utc-datetime)[![License](https://camo.githubusercontent.com/f3d1d049d514031044cb1276bf0a576e85bf2048fcfd037ac25e4eba20cbfc4a/68747470733a2f2f706f7365722e707567782e6f72672f736c6c682f646f637472696e652d6462616c2d7574632d6461746574696d652f6c6963656e7365)](https://packagist.org/packages/sllh/doctrine-dbal-utc-datetime)

[![Total Downloads](https://camo.githubusercontent.com/c06d6cb7c3166610e79093e3d839edf109193b23e37452f41922d77fc9a88cd3/68747470733a2f2f706f7365722e707567782e6f72672f736c6c682f646f637472696e652d6462616c2d7574632d6461746574696d652f646f776e6c6f616473)](https://packagist.org/packages/sllh/doctrine-dbal-utc-datetime)[![Monthly Downloads](https://camo.githubusercontent.com/dd802c1493149d2e8dae1f140f737e43b9e7146e15a99768281699b6121b3eec/68747470733a2f2f706f7365722e707567782e6f72672f736c6c682f646f637472696e652d6462616c2d7574632d6461746574696d652f642f6d6f6e74686c79)](https://packagist.org/packages/sllh/doctrine-dbal-utc-datetime)[![Daily Downloads](https://camo.githubusercontent.com/4dd103c2d6a8ba91f49e3fa511059c8127fac74cabcda178c3a65a55429858eb/68747470733a2f2f706f7365722e707567782e6f72672f736c6c682f646f637472696e652d6462616c2d7574632d6461746574696d652f642f6461696c79)](https://packagist.org/packages/sllh/doctrine-dbal-utc-datetime)

[![Build Status](https://camo.githubusercontent.com/3cdfdfe752f2917f9f83aa2f9011759dbef1d76c0859f3b2896b69f4d81852e1/68747470733a2f2f7472617669732d63692e6f72672f536f756c6c6976616e6575682f646f637472696e652d6462616c2d7574632d6461746574696d652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Soullivaneuh/doctrine-dbal-utc-datetime)[![Coverage Status](https://camo.githubusercontent.com/59c9a4256f09f16ebe9e2c7ad6580c59e0995d37cd658d3bb2d60ee560a941a4/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f536f756c6c6976616e6575682f646f637472696e652d6462616c2d7574632d6461746574696d652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/r/Soullivaneuh/doctrine-dbal-utc-datetime?branch=master)

Why this DBAL Type?
-------------------

[](#why-this-dbal-type)

This special type allow you to be sure to **always** save any DateTime to the UTC format.

The goal is to get rid of the quite hazardous timezone management of many database vendors.

For more information, please read the [official Doctrine wiki page](http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/cookbook/working-with-datetime.html#handling-different-timezones-with-the-datetime-type), where this class come from.

Setup
-----

[](#setup)

First of all, you need to require this library through composer:

```
composer require sllh/doctrine-dbal-utc-datetime
```

Then, replace the default `datetime` and `datetimetz` DBAL types:

```
use Doctrine\DBAL\Types\Type;
use SLLH\Doctrine\DBAL\Types\UTCDateTimeType;

Type::overrideType('datetime', UTCDateTimeType::class);
Type::overrideType('datetimetz', UTCDateTimeType::class);
```

If you are using [Symfony](http://symfony.com/), you can override the type trough the `config.yml` file:

```
doctrine:
    dbal:
        types:
            datetime: SLLH\Doctrine\DBAL\Types\UTCDateTimeType
            datetimetz: SLLH\Doctrine\DBAL\Types\UTCDateTimeType
```

And voilà! You are good to go. Happy coding!

License
-------

[](#license)

This bundle is under the MIT license. See the complete license on the [LICENSE](LICENSE) file.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

3152d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ddfefb214260c4bfc0ecdd78842fc4b21bef42930fa8e4e55bb3a410c84baeac?d=identicon)[Soullivaneuh](/maintainers/Soullivaneuh)

---

Top Contributors

[![soullivaneuh](https://avatars.githubusercontent.com/u/1698357?v=4)](https://github.com/soullivaneuh "soullivaneuh (3 commits)")

---

Tags

doctrinedbaldatetimeutc

### Embed Badge

![Health badge](/badges/sllh-doctrine-dbal-utc-datetime/health.svg)

```
[![Health](https://phpackages.com/badges/sllh-doctrine-dbal-utc-datetime/health.svg)](https://phpackages.com/packages/sllh-doctrine-dbal-utc-datetime)
```

###  Alternatives

[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.

4485.3M4](/packages/martin-georgiev-postgresql-for-doctrine)[fresh/doctrine-enum-bundle

Provides support of ENUM type for Doctrine2 in Symfony applications.

4636.8M12](/packages/fresh-doctrine-enum-bundle)[jsor/doctrine-postgis

Spatial and Geographic Data with PostGIS and Doctrine.

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

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

1752.3M55](/packages/larapack-doctrine-support)[vasek-purchart/doctrine-date-time-immutable-types

Doctrine DateTimeImmutable types

42228.3k](/packages/vasek-purchart-doctrine-date-time-immutable-types)[friendsofdoctrine/dbal-clickhouse

Doctrine DBAL driver for ClickHouse

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

PHPackages © 2026

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