To override the default Doctrine\DBAL\Types\DateTimeType :
- use the
config.yml - you can enable it only when you need it with
Type::overrideType('datetime', 'AppBundle\Doctrine\DBAL\Types\UTCDateTimeType');If you need to create a DateTime and you dont want to autoconvert to UTC you can instantiate new DateTimeNotConvertable
it only skip the DBAL convertion