<p dir="auto">Hi all,</p>
<p dir="auto">I've got some problems with the intl component.</p>
<p dir="auto">I have a form where the user can pick a date and a time, but when the time is "cast" in the controller, the hours is two hours back. For example if i pick 10:10 in the form i will have 08:10 in my controller.</p>
<p dir="auto">Please take a look at my post (it's french but the important think are the code and the profiler view)<br>
<a href="https://openclassrooms.com/forum/sujet/probleme-date-timezone?page=1#message-91356928" rel="nofollow">https://openclassrooms.com/forum/sujet/probleme-date-timezone?page=1#message-91356928</a></p>
<p dir="auto">Setting Europe/Zurich in the php.ini doesn't resolve the bug (and the default timezone is set to Europe/Zurich as we can see).</p>
<p dir="auto">Removing the intl component fix the bug, so i think i'm missing some configuration at one moment</p>
<p dir="auto">Thanks in advance for your help :)</p>
<p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="169390852" data-permission-text="Title is private" data-url="https://github.com/symfony/symfony/issues/19531" data-hovercard-type="issue" data-hovercard-url="/symfony/symfony/issues/19531/hovercard" href="https://github.com/symfony/symfony/issues/19531">#19531</a></p>
<p dir="auto">After merge issue above, there is bug on the DateTimeType::class form type - DateTimeToLocalizedStringTransformer class on branch master.</p>
<p dir="auto">My timezone is Europe/Warsaw, +2h from UTC timezone.</p>
<p dir="auto">Part of form:</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$builder-&gt;add(
                'publishDateEnd',
                DateTimeType::class,
                [
                    'required' =&gt; false,
                    'widget' =&gt; 'single_text',
                    'format' =&gt; 'dd.MM.yyyy HH:mm',
                    'attr' =&gt; [
                        'placeholder' =&gt; 'dd.mm.yyyy HH:mm',
                    ],
                ]"><pre class="notranslate"><span class="pl-s1"><span class="pl-c1">$</span>builder</span>-&gt;add(
                <span class="pl-s">'publishDateEnd'</span>,
                <span class="pl-v">DateTimeType</span>::class,
                [
                    <span class="pl-s">'required'</span> =&gt; <span class="pl-c1">false</span>,
                    <span class="pl-s">'widget'</span> =&gt; <span class="pl-s">'single_text'</span>,
                    <span class="pl-s">'format'</span> =&gt; <span class="pl-s">'dd.MM.yyyy HH:mm'</span>,
                    <span class="pl-s">'attr'</span> =&gt; [
                        <span class="pl-s">'placeholder'</span> =&gt; <span class="pl-s">'dd.mm.yyyy HH:mm'</span>,
                    ],
                ]</pre></div>
<p dir="auto">When for example publishDateEnd is set as 2016-08-01 10:00:00 and I set in the web form date as 2016-08-01 12:00:00, after save form date back to 2016-08-01 10:00:00. Should be saved as 2016-08-01 12:00:00.</p>
<p dir="auto">When I add 'view_timezone' =&gt; 'UTC' into widget option, date is display as correct date, but is invalid in database</p>
<p dir="auto">My php.ini timezone is set as Europe/Warsaw</p>