title: Testing ActiveSupport::TimeWithZone objects for equality
body: <p>Can someone explain how d1 is greater than d2?  They are the same damn dates (or atleast that is how they look to me).</p>
  
  <pre><code>Loading development environment (Rails 3.0.8)
  ruby-1.9.2-p180 :001 &gt; d1 = Event.first.updated_at
   =&gt; Thu, 22 Sep 2011 02:24:28 PDT -07:00 
  ruby-1.9.2-p180 :002 &gt; d2 = Time.zone.parse("2011-09-22T02:24:28-07:00")
   =&gt; Thu, 22 Sep 2011 02:24:28 PDT -07:00 
  ruby-1.9.2-p180 :003 &gt; d1.class
   =&gt; ActiveSupport::TimeWithZone 
  ruby-1.9.2-p180 :004 &gt; d2.class
   =&gt; ActiveSupport::TimeWithZone 
  ruby-1.9.2-p180 :005 &gt; d1 &gt; d2
   =&gt; true 
  ruby-1.9.2-p180 :006 &gt; 
  </code></pre>
  
  <p>With regards to my specific application needs ... I have an iOS app that makes a request to my Rails application passing a JSON object that, amongst other items, includes NSDates in the format of "2011-09-22T02:24:28-07:00."  I'm attempting to compare that datetime with the "updated_at" which is of type ActiveSupport::TimeWithZone.</p>
  
  <p>Thanks - wg</p>