Uploaded image for project: 'Doctrine DBAL'
  1. Doctrine DBAL
  2. DBAL-92

Timezones of DateTime instances are ignored when persisting dates

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: 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

        bschussek Bernhard Schussek created issue -
        Hide
        beberlei 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
        beberlei 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.
        beberlei Benjamin Eberlei made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Invalid [ 6 ]
        beberlei Benjamin Eberlei made changes -
        Workflow jira [ 12394 ] jira-feedback2 [ 17698 ]
        beberlei 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={expand=changesets[0:20].revisions[0:29],reviews, query=DBAL-92}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

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

            Dates

            • Created:
              Updated:
              Resolved: