title: Time maximums in Windows shell and Why?
body: <p>I made a <em>simple countdown</em> in <a href="https://en.wikibooks.org/wiki/Windows_Batch_Scripting" rel="nofollow noreferrer">Windows Batch Scripting</a>:</p>
  
  <pre class="lang-vbs prettyprint-override"><code>@ECHO OFF
  MODE con: cols=13 lines=2
  COLOR 4f
  TITLE Countdown Timer
  SET /p m=? Minutes:
  SET /a s = 60 * m
  FOR /l %%a in (%s%,-1,1) do (
    ECHO %%a/%s%
    PING -n 2 127.0.0.1 &gt;NUL 2&gt;&amp;1
    CLS
  )
  IF ERRORLEVEL 1 EXIT
  CSCRIPT alert.vbs
  EXIT
  </code></pre>
  
  <p>and I noticed the following things:</p>
  
  <ol>
  <li>the maximum <em>seconds</em> that I can use, is exactly the <a href="https://en.wikipedia.org/wiki/2%2C147%2C483%2C647" rel="nofollow noreferrer">eighth Mersenne prime:</a> <code>2147483647</code> <em>(<a href="https://duckduckgo.com/?q=2147483647+seconds+to+years&amp;atb=v145-7__&amp;ia=answer" rel="nofollow noreferrer">2147483647 seconds to years at DuckDuckGo</a>)</em>, but</li>
  <li>if I use the multiplier <code>60</code> to start the <em>countdown</em> with <em>minutes</em>, the maximum accepted integer is <code>1037950429.99999999</code>.
  
  <ul>
  <li><em><a href="https://duckduckgo.com/?q=1037950429.99999999+minutes+to+years&amp;atb=v145-7__&amp;ia=answer" rel="nofollow noreferrer">1037950429.99999999 minutes to years</a></em> equals <code>1973.43904479</code> which refers to the day of <a href="https://en.wikipedia.org/wiki/June_1973#June_10,_1973_(Sunday)" rel="nofollow noreferrer">June 10, 1973</a> 9:00 AM, but from my research nothing special happened in that day.</li>
  </ul></li>
  </ol>
  
  <p>Doing my research to understand <strong>why(?)</strong>, led me to ask this question.</p>
  
  <p><a href="https://i.stack.imgur.com/MlAUJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MlAUJ.png" alt="windows command calculations"></a></p>