title: How to calculate the difference between two ActionScript Date objects, in months?
body: <p>I have to validate that 1) the end Date is not less than the start Date and 2) the difference between the two UTC Dates is not more than 12 months. To do this, I need a <code>monthDifference</code> function:</p>
  
  <pre><code>public static function monthDifference(start:Date, end:Date):int;
  </code></pre>
  
  <p>Since partial months can be confusing, this is how month differences are supposed to work:</p>
  
  <ul>
  <li>The month difference between January 1, 2010 and January 31, 2010 is zero <strong>(0)</strong>.</li>
  <li>The month difference between January 31, 2010 and February 1, 2010 is one <strong>(1)</strong>.</li>
  <li>The month difference between January 1, 2010 and February 28, 2010 is one <strong>(1)</strong>.</li>
  <li>The month difference between January 1, 2010 and March 1, 2010 is two <strong>(2)</strong>.</li>
  </ul>
  
  <p>How can I calculate month difference in ActionScript 3.0?</p>