title: Standards for Date/Time addition?
body: <p>I'm looking for standards for Date/Time addition. I haven't been able to find any. In particular I'm hoping to find a spec that defines what should happen when you add a month to a date like January 31st. Is the right answer February 28th(/29th)? March 1st? March 2nd?</p>
  
  <p>I've seen inconsistent implementations between different tools (PHP &amp; MySQL in this case), and I'm trying to find some sort of standards to base my work on.</p>
  
  <p>Differing Results:</p>
  
  <p><strong>PHP</strong></p>
  
  <pre><code>$end = strtotime("+1 month", 1314835200);
  //1317513600   Sat, 01 Oct 2011 20:00:00 -0400
  </code></pre>
  
  <p><strong>MySQL</strong></p>
  
  <pre><code>SELECT UNIX_TIMESTAMP(DATE_ADD(FROM_UNIXTIME(1314835200), INTERVAL 1 MONTH));
  #1317427200    Fri, 30 Sep 2011 20:00:00 -0400
  </code></pre>
  
  <p><strong>Oracle</strong></p>
  
  <pre><code>SELECT ADD_MONTHS('31-Aug-11', 1) FROM dual;
  #30-SEP-11
  </code></pre>
  
  <p>(sorry for the format change, my oracle foo is weak)</p>
  
  <p><strong>Java</strong></p>
  
  <pre><code>Calendar c = Calendar.getInstance();
  c.clear();
  c.set( 2011, Calendar.AUGUST, 31 );
  c.add( Calendar.MONTH, 1 );
  c.getTime()
  #Fri Sep 30 00:00:00 EDT 2011
  </code></pre>