Skip to content

Instantly share code, notes, and snippets.

@jalada
Created June 7, 2011 13:45
Show Gist options
  • Save jalada/1012283 to your computer and use it in GitHub Desktop.
Save jalada/1012283 to your computer and use it in GitHub Desktop.
Time.parse fails with really old dates?
REE 1.8.7:
ree-1.8.7-2011.03 :001 > require 'time'
=> true
ree-1.8.7-2011.03 :002 > Time.parse "Tue Oct 27 00:00:00 UTC 1896"
ArgumentError: time out of range
from /usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/time.rb:180:in `utc'
from /usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/time.rb:180:in `make_time'
from /usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/time.rb:243:in `parse'
from (irb):2
Ruby 1.8.7:
ruby-1.8.7-p334 :001 > require 'time'
=> true
ruby-1.8.7-p334 :002 > Time.parse "Tue Oct 27 00:00:00 UTC 1896"
=> Tue Oct 27 00:00:00 UTC 1896
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment