[DBAL-92] Timezones of DateTime instances are ignored when persisting dates Created: 16/Feb/11 Updated: 26/Feb/11 Resolved: 26/Feb/11
|Reporter:||Bernhard Schussek||Assignee:||Benjamin Eberlei|
When a DateTime instance, e.g. "2011-02-16 00:00:00 America/New_York" is written into the DB, the timezone is ignored and only "2011-02-16" is persisted. When fetching the date, it is written into a DateTime with the server's timezone, resulting in for example "2011-02-16 00:00:00 Europe/Berlin" which is not correct!
To fix this issue, Doctrine should convert dates to the server's timezone (if their own timezone differs) before persisting them or before executing queries containing DateTime instances.
|Comment by Benjamin Eberlei [ 26/Feb/11 ]|
This would magically change the state of any DateTime instance upon "convertToDatabaseValue", i think this would be equally weird so better no changes at all.