<p dir="auto">Hello,</p>
<p dir="auto">Why a date field with the options below is it limited. Choice available between 1902 and 2037?</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$Builder-&gt; add ('date', 'date', array (
    'input' =&gt; 'datetime'
    'widget' =&gt; 'choice'
    'years' =&gt; range (1850,2050) &quot;
));"><pre class="notranslate"><span class="pl-s1"><span class="pl-c1">$</span><span class="pl-v">Builder</span></span>-&gt; <span class="pl-en">add</span> (<span class="pl-s">'date'</span>, <span class="pl-s">'date'</span>, <span class="pl-en">array</span> (
    <span class="pl-s">'input'</span> =&gt; <span class="pl-s">'datetime'</span>
    'widget' =&gt; 'choice'
    'years' =&gt; range (<span class="pl-c1">1850</span>,<span class="pl-c1">2050</span>) "
));</pre></div>
<p dir="auto">documentation says:</p>
<blockquote>
<p dir="auto">If timestamp is used, DateType is limited to dates entre Fri, Dec. 13, 1901 8:45:54 p.m. GMT and Tue, January 19, 2038 3:14:07 GMT on 32bit systems. This is due to a limitation in PHP Itself.</p>
</blockquote>
<p dir="auto">Is it normal that the option datetime have the same limitation?<br>
For information i use symfony 2.3</p>
<p dir="auto">Thank you for this great framework.</p>
<p dir="auto"><a href="https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Extension/Core/Type/DateType.php#L277">https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/Extension/Core/Type/DateType.php#L277</a></p>
<p dir="auto">When I set date options like</p>
<div class="highlight highlight-text-html-php notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$builder-&gt;add('expire', 'date', array('years' =&gt; range(2000, 2100)));"><pre class="notranslate"><span class="pl-s1"><span class="pl-c1">$</span>builder</span>-&gt;<span class="pl-en">add</span>(<span class="pl-s">'expire'</span>, <span class="pl-s">'date'</span>, <span class="pl-en">array</span>(<span class="pl-s">'years'</span> =&gt; range(<span class="pl-c1">2000</span>, <span class="pl-c1">2100</span>)));</pre></div>
<p dir="auto">year choice field shows</p>
<div class="highlight highlight-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&lt;select&gt;
&lt;option value=&quot;2000&quot;&gt;2000&lt;/option&gt;
&lt;option value=&quot;2000&quot;&gt;2000&lt;/option&gt;
...
&lt;option value=&quot;2037&quot;&gt;2037&lt;/option&gt;
&lt;option value=&quot;2038&quot;&gt;&lt;/option&gt;
&lt;option value=&quot;2039&quot;&gt;&lt;/option&gt;
...
&lt;option value=&quot;2100&quot;&gt;&lt;/option&gt;"><pre class="notranslate"><span class="pl-kos">&lt;</span><span class="pl-ent">select</span><span class="pl-kos">&gt;</span>
<span class="pl-kos">&lt;</span><span class="pl-ent">option</span> <span class="pl-c1">value</span>="<span class="pl-s">2000</span>"<span class="pl-kos">&gt;</span>2000<span class="pl-kos">&lt;/</span><span class="pl-ent">option</span><span class="pl-kos">&gt;</span>
<span class="pl-kos">&lt;</span><span class="pl-ent">option</span> <span class="pl-c1">value</span>="<span class="pl-s">2000</span>"<span class="pl-kos">&gt;</span>2000<span class="pl-kos">&lt;/</span><span class="pl-ent">option</span><span class="pl-kos">&gt;</span>
...
<span class="pl-kos">&lt;</span><span class="pl-ent">option</span> <span class="pl-c1">value</span>="<span class="pl-s">2037</span>"<span class="pl-kos">&gt;</span>2037<span class="pl-kos">&lt;/</span><span class="pl-ent">option</span><span class="pl-kos">&gt;</span>
<span class="pl-kos">&lt;</span><span class="pl-ent">option</span> <span class="pl-c1">value</span>="<span class="pl-s">2038</span>"<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">option</span><span class="pl-kos">&gt;</span>
<span class="pl-kos">&lt;</span><span class="pl-ent">option</span> <span class="pl-c1">value</span>="<span class="pl-s">2039</span>"<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">option</span><span class="pl-kos">&gt;</span>
...
<span class="pl-kos">&lt;</span><span class="pl-ent">option</span> <span class="pl-c1">value</span>="<span class="pl-s">2100</span>"<span class="pl-kos">&gt;</span><span class="pl-kos">&lt;/</span><span class="pl-ent">option</span><span class="pl-kos">&gt;</span></pre></div>
<p dir="auto">It's perhaps because <code class="notranslate">gmmktime</code> on 32-bit is only suitable for up to 2038-01-19 03:14:07 .</p>
<p dir="auto">On 32-bit php</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ php -r 'echo gmmktime(0,0,0,6,15,2037);'
2128636800
$ php -r 'echo gmmktime(0,0,0,6,15,2038);'
## shows nothing ##
$ php -r 'var_dump(gmmktime(0,0,0,6,15,2038));'
bool(false)"><pre class="notranslate">$ php -r <span class="pl-s"><span class="pl-pds">'</span>echo gmmktime(0,0,0,6,15,2037);<span class="pl-pds">'</span></span>
2128636800
$ php -r <span class="pl-s"><span class="pl-pds">'</span>echo gmmktime(0,0,0,6,15,2038);<span class="pl-pds">'</span></span>
<span class="pl-c"><span class="pl-c">#</span># shows nothing ##</span>
$ php -r <span class="pl-s"><span class="pl-pds">'</span>var_dump(gmmktime(0,0,0,6,15,2038));<span class="pl-pds">'</span></span>
bool(false)</pre></div>
<p dir="auto">On 64-bit php</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="$ php -r 'echo gmmktime(0, 0, 0, 6, 15, 2037);'
2128636800
$ php -r 'echo gmmktime(0, 0, 0, 6, 15, 2038);'
2160172800"><pre class="notranslate">$ php -r <span class="pl-s"><span class="pl-pds">'</span>echo gmmktime(0, 0, 0, 6, 15, 2037);<span class="pl-pds">'</span></span>
2128636800
$ php -r <span class="pl-s"><span class="pl-pds">'</span>echo gmmktime(0, 0, 0, 6, 15, 2038);<span class="pl-pds">'</span></span>
2160172800</pre></div>