Doctrine UTC Date Time
, (*1)
Introduction
Component contains DBAL
types for date and time and can be registered as Doctrine
types. DBAL
types provides
functionality for storing date and time into database in the UTC
. List of the available types:, (*2)
Installation
Open a command console, enter your project directory and execute the following command to download the latest stable
version of this component:, (*3)
composer require adrenalinkin/doctrine-utc-date-time
This command requires you to have Composer install globally., (*4)
Usage
For registration new Doctrine
type use official instruction
How to Use Doctrine DBAL., (*5)
For registration new separate UTC types:, (*6)
# app/config/config.yml
doctrine:
dbal:
types:
utc_date: Linkin\Component\DoctrineUTCDateTime\DBAL\Types\UtcDateType
utc_datetime: Linkin\Component\DoctrineUTCDateTime\DBAL\Types\UtcDateTimeType
utc_time: Linkin\Component\DoctrineUTCDateTime\DBAL\Types\UtcTimeType
Also, you can overwrite standard types:, (*7)
# app/config/config.yml
doctrine:
dbal:
types:
date: Linkin\Component\DoctrineUTCDateTime\DBAL\Types\UtcDateType
datetime: Linkin\Component\DoctrineUTCDateTime\DBAL\Types\UtcDateTimeType
time: Linkin\Component\DoctrineUTCDateTime\DBAL\Types\UtcTimeType
License
, (*8)