simpod/doctrine-utcdatetime

Doctrine UTC DateTime

Fund package maintenance!
simPod

0.1.3 2021-10-04 13:55 UTC

This package is auto-updated.

Last update: 2021-10-04 13:56:28 UTC


README

Build Status Coverage Status Downloads Packagist Type Coverage

Contains DateTime and DateTimeImmutable Doctrine DBAL types that store datetimes in UTC timezone (TIMESTAMP type in postgres).

For more detailed explanation see this comment.

For more info about usage in Doctrine ORM see Doctrine documentation. The code is mostly copied from there.

Using the UTCDateTimeType

Installation

composer require simpod/doctrine-utcdatetime

Overriding default types in Symfony

Simply copied from DoctrineExtensions' documentation:

doctrine:
    dbal:
        types:
            datetime: SimPod\DoctrineUtcDateTime\UTCDateTimeType
            datetimetz: SimPod\DoctrineUtcDateTime\UTCDateTimeType
            datetime_immutable: SimPod\DoctrineUtcDateTime\UTCDateTimeImmutableType
            datetimetz_immutable: SimPod\DoctrineUtcDateTime\UTCDateTimeImmutableType