[DBAL-92] Timezones of DateTime instances are ignored when persisting dates Created: 16/Feb/11  Updated: 26/Feb/11  Resolved: 26/Feb/11

Status: Resolved
Project: Doctrine DBAL
Component/s: None
Affects Version/s: 2.0.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Bernhard Schussek Assignee: Benjamin Eberlei
Resolution: Invalid Votes: 0
Labels: None


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.

Generated at Sun Oct 04 21:38:25 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.