DDC-179 - Use ! modifier in Date Format to reset all non-date parts to zero unix timestamp values, i.e. H:i:s => '00:00:00' always
This commit is contained in:
parent
03d69eea77
commit
83b247b812
@ -1719,7 +1719,7 @@ abstract class AbstractPlatform
|
|||||||
*/
|
*/
|
||||||
public function getDateFormatString()
|
public function getDateFormatString()
|
||||||
{
|
{
|
||||||
return 'Y-m-d';
|
return '!Y-m-d';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -34,4 +34,11 @@ class DateTest extends \Doctrine\Tests\DbalTestCase
|
|||||||
instanceof \DateTime
|
instanceof \DateTime
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testDateResetsNonDatePartsToZeroUnixTimeValues()
|
||||||
|
{
|
||||||
|
$date = $this->_type->convertToPHPValue('1985-09-01', $this->_platform);
|
||||||
|
|
||||||
|
$this->assertEquals('00:00:00', $date->format('H:i:s'));
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user