propelorm / Propel

Current stable (and outdated and unmaintained) version of Propel - Please use v2 https://github.com/propelorm/Propel2 --
http://www.propelorm.org
MIT License
841 stars 418 forks source link

"Error parsing date/time value" hiding \DateTime exception. TimeZone Not Set in php.ini #838

Open fishjd opened 10 years ago

fishjd commented 10 years ago

As a Newbie to Propel. My second attempt to read from the database threw an exception ""Error parsing date/time value"

The problem is Propel hides the underlying exception from \DateTime. Which stated to set my php.ini\timezone. This may be a PHP_unit bug of not printing the underlying exception. I looked at the code and it is passing the underlying exception but it is not displaying in the php_unit output. See https://github.com/propelorm/Propel2/blob/master/src/Propel/Runtime/Util/PropelDateTime.php line 96.

Maybe some other Newbie will read this and save themselves a headache.

Bottom line: In PHP 5.5 if you are using the base php \DateTime object the timezone must be set either in the php.ini or using date_default_timezone_set() .

thenetimp commented 9 years ago

I just had this exact same problem. This exception on line 96 should be handled better. @fishjd thanks for helping me solve my issue by reporting this initially