Beispiel #1
0
 /**
  * @param  string                                $value
  * @param  DoctrineDBALPlatformsAbstractPlatform $platform
  * @return DateTime|mixed|null
  * @throws DoctrineDBALTypesConversionException
  */
 public function convertToPHPValue($value, AbstractPlatform $platform)
 {
     $val = parent::convertToPHPValue($value, $platform);
     return $val->setTimezone(new \DateTimeZone('America/Sao_Paulo'));
 }
 /**
  * Tests UtcDateTimeType->convertToPHPValue()
  */
 public function testConvertToPHPValue()
 {
     $dt = \DateTime::createFromFormat('d/m/Y H:i:s', '05/02/2015 09:10:11', new \DateTimeZone('UTC'));
     $this->assertEquals($dt, $this->UtcDateTimeType->convertToPHPValue('2015-02-05 09:10:11', $this->platform));
 }