1
0
mirror of synced 2025-02-20 06:03:15 +03:00

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:
beberlei 2010-01-13 18:11:34 +00:00
parent 03d69eea77
commit 83b247b812
2 changed files with 8 additions and 1 deletions

View File

@ -1719,7 +1719,7 @@ abstract class AbstractPlatform
*/
public function getDateFormatString()
{
return 'Y-m-d';
return '!Y-m-d';
}
/**

View File

@ -34,4 +34,11 @@ class DateTest extends \Doctrine\Tests\DbalTestCase
instanceof \DateTime
);
}
public function testDateResetsNonDatePartsToZeroUnixTimeValues()
{
$date = $this->_type->convertToPHPValue('1985-09-01', $this->_platform);
$this->assertEquals('00:00:00', $date->format('H:i:s'));
}
}