Skip to content

[Form] DateType does not convert timezone  #21217

Closed
@magnetik

Description

@magnetik
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 2.7

The DateTimeToLocalizedStringTransformer when used with a pattern that have only date (in DateType for instance) does not convert the result in the desired output

Reproduction steps:

  • Use DateType in a form
  • Set the model_timezone to Pacific/Tahiti, having default timezone to Europe/Berlin.
  • Enter the date 2017-01-10
  • Submit the form
  • Notice that the received data is 2017-01-10 00:00 Europe/Berlin, whereas it should be 2017-01-10 11:00 Europe/Berlin

Incoming pull request with tests and proposed resolution.

(ping @tsurenas for finding it)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions