title: Actionscript Date Comparison
body: <p>In my Actionscript code I have two dates:</p>
  
  <pre><code>var date1:Date = new Date(2011,1,1);
  var date2:Date = new Date(2011,1,1);
  </code></pre>
  
  <p>This doesn't work:</p>
  
  <pre><code>var equal:Boolean = date1 == date2;
  </code></pre>
  
  <p>From reading I've found that this is a working alternative since it just gets the number of milliseconds from a standard point in time.</p>
  
  <pre><code>var equal:Boolean = date1.getTime() == date2.getTime();
  </code></pre>
  
  <p>So my questions are:</p>
  
  <ol>
  <li>Why doesn't the normal equality operator work on Dates in actionscript?</li>
  <li>">" as well as "&lt;" operators seem to work fine, but can they be trusted?</li>
  <li>Why would they work but not the equality operator?</li>
  <li>Is there a standard method I can use when comparing dates that just returns a -1, 0, or 1 (I realize I can easily create my own, but I would rather use an existing utility class)?</li>
  </ol>
  
  <p>Thanks in advance.</p>