title: JavaScript, get date of the next day
body: <p>I have the following script which returns the next day:</p>
  
  <pre><code>function today(i)
      {
          var today = new Date();
          var dd = today.getDate()+1;
          var mm = today.getMonth()+1;
          var yyyy = today.getFullYear();
  
          today = dd+'/'+mm+'/'+yyyy;
  
          return today;   
      }
  </code></pre>
  
  <p>By using this:</p>
  
  <pre><code>today.getDate()+1;
  </code></pre>
  
  <p>I am getting the next day of the month (for example today would get 16).</p>
  
  <p>My problem is that this could be on the last day of the month, and therefore end up returning <strong>32/4/2014</strong></p>
  
  <p>Is there a way I can get the guaranteed correct date for the next day?</p>