oskarstark/doctrine-datetime-milliseconds-type

A Doctrine DBAL type to store DateTime with milliseconds

Installs: 71

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/oskarstark/doctrine-datetime-milliseconds-type

2.4.0 2025-10-22 13:06 UTC

README

Branch PHP
master PHP

Usage

Installation

composer require oskarstark/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: OskarStark\Doctrine\Type\Doctrine\DBAL\Types\Type\DateTimeMillisecondsType