-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Labels
Description
This thing explained here #3673.
I have a date field in my entity and form for it.
in database: 31.10.2011
at form: 30.10.2011
symfony 2.1.1-DEV
my timezone set to "Asia/Yekaterinburg" in php.ini
Problem somewhere at this lines at DateTimeToLocalizedStringTransformer
echo $dateTime->format('d.m.Y H:i:s T');
// convert time to UTC before passing it to the formatter
$dateTime = clone $dateTime;
if ('UTC' !== $this->inputTimezone) {
$dateTime->setTimezone(new \DateTimeZone('UTC'));
}
echo $dateTime->format('d.m.Y H:i:s T');
31.10.2011 00:00:00 YEKT
30.10.2011 18:00:00 UTC
Why do symfony convert date to UTC before being shown it in the form