datana-gmbh/doctrine-datetime-milliseconds-type

A Doctrine DBAL type to store DateTime with milliseconds

2.1.0 2022-10-04 06:33 UTC

This package is auto-updated.

Last update: 2024-06-04 10:04:07 UTC


README

Branch PHP Code Coverage
master PHP Code Coverage

Usage

Installation

composer require datana-gmbh/doctrine-datetime-milliseconds-type

Setup

# config/packages/doctrine.yaml

doctrine:
    dbal:
        types:
            # We want to store DateTime objects with milliseconds
            # The solution is built on https://github.com/doctrine/dbal/issues/2873#issuecomment-701052412
            # but instead of using microseconds we use milliseconds
            datetime: Datana\Doctrine\Type\Doctrine\DBAL\Types\Type\DateTimeMillisecondsType