Closed
Description
Symfony version(s) affected: 5.2.6 (at least)
Description
When you use the TimeType
in forms with the input
type set to array
and then you set different view_timezone
and model_timezone
options the conversion will be inconsistant. When you load save it the timezone is correct but when you load it it's off.
How to reproduce
- Get a TimeType form field
- Set input to array
- Set model_timezone to UTC
- Set view_timezone to Europe/Berlin
- Enter a date and save it to a database
- Navigate away and reload that value
Possible Solution
https://github.com/symfony/form/blob/8822890bdb6267f8d1c027f697db4bd83c2afc55/Extension/Core/Type/TimeType.php#L208 is not set like it's in line 193, set it and it will work