<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,6 @@
 = ActiveMerchant CHANGELOG
 
+* Don't use Time.parse for the ExpiryDate [cody]
 * Add support for CVV code to Authorize.net CIM [Guy Naor]
 * Add shipping address to Authorize.net [Eric Tarn]
 * Don't setup the logger by default [cody]</diff>
      <filename>CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -1,19 +1,25 @@
+require 'date'
+
 module ActiveMerchant
   module Billing
     class CreditCard
       class ExpiryDate #:nodoc:
         attr_reader :month, :year
         def initialize(month, year)
-          @month = month
-          @year = year
+          @month = month.to_i
+          @year = year.to_i
         end
         
         def expired? #:nodoc:
-          Time.now &gt; expiration rescue true
+          Time.now.utc &gt; expiration
         end
         
         def expiration #:nodoc:
-          Time.parse(&quot;#{month}/#{month_days}/#{year} 23:59:59&quot;) rescue Time.at(0)
+          begin
+            Time.utc(year, month, month_days, 23, 59, 59)
+          rescue ArgumentError
+            Time.at(0).utc
+          end
         end
         
         private</diff>
      <filename>lib/active_merchant/billing/expiry_date.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,7 @@ class ExpiryDateTest &lt; Test::Unit::TestCase
   end
   
   def test_today_should_not_be_expired
-    today = Time.now
+    today = Time.now.utc
     date = CreditCard::ExpiryDate.new(today.month, today.year)
     assert_false date.expired?
   end
@@ -18,4 +18,15 @@ class ExpiryDateTest &lt; Test::Unit::TestCase
     date = CreditCard::ExpiryDate.new(next_month.month, next_month.year)
     assert_false date.expired?
   end
+  
+  def test_invalid_date
+    expiry = CreditCard::ExpiryDate.new(13, 2009)
+    assert_equal Time.at(0).utc, expiry.expiration
+  end
+  
+  def test_month_and_year_coerced_to_integer
+    expiry = CreditCard::ExpiryDate.new(&quot;13&quot;, &quot;2009&quot;)
+    assert_equal 13, expiry.month
+    assert_equal 2009, expiry.year
+  end
 end
\ No newline at end of file</diff>
      <filename>test/unit/expiry_date_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ffb1fd67ef52c486df548f21767e9defd8fd9893</id>
    </parent>
  </parents>
  <author>
    <name>Cody Fauser</name>
    <email>codyfauser@gmail.com</email>
  </author>
  <url>http://github.com/artofmission/active_merchant/commit/0ed2db98ab2b48170ac16e4a71a760fca210510c</url>
  <id>0ed2db98ab2b48170ac16e4a71a760fca210510c</id>
  <committed-date>2009-05-20T19:47:01-07:00</committed-date>
  <authored-date>2009-05-20T19:47:01-07:00</authored-date>
  <message>Don't use Time.parse for the ExpiryDate</message>
  <tree>0a2ede955f8da7df666fcdd4f5334a511fd0e328</tree>
  <committer>
    <name>Cody Fauser</name>
    <email>codyfauser@gmail.com</email>
  </committer>
</commit>
