Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-92

Timezones of DateTime instances are ignored when persisting dates

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 2.0.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      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.

        Activity

        Bernhard Schussek created issue -
        Hide
        Benjamin Eberlei added a comment -

        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.

        Show
        Benjamin Eberlei added a comment - 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.
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Invalid [ 6 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 12394 ] jira-feedback2 [ 17698 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 17698 ] jira-feedback3 [ 20053 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DBAL-92, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Bernhard Schussek
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: