From: Eric Hodel Date: 2006-05-02T04:29:30+09:00 Subject: Re: time.parse fails for year values > 2037 (time out of range) in ruby 1.8.4 On Apr 28, 2006, at 7:15 AM, Peter Krantz wrote: > Hi! > > I am trying to parse dates that take place in the future. When event > dates occur after 2038-01-01 i get an time out of range error. To > reproduce in irb: > > irb(main):078:0> t = "2038-12-01T15:00:00.000Z" > => "2038-12-01T15:00:00.000Z" > > irb(main):079:0> s = "2012-12-01T15:00:00.000Z" > => "2012-12-01T15:00:00.000Z" > > irb(main):080:0> Time::parse(s) > => Sat Dec 01 15:00:00 UTC 2012 > > irb(main):081:0> Time::parse(t) > ArgumentError: time out of range > from /opt/local/lib/ruby/1.8/time.rb:180:in `utc' > from /opt/local/lib/ruby/1.8/time.rb:180:in `make_time' > from /opt/local/lib/ruby/1.8/time.rb:243:in `parse' > from (irb):81 > > I am running ruby 1.8.4 (2005-12-24) [i686-darwin8.6.1]. > > Am I doing something wrong or is this a bug? Use a machine with a 64 bit time_t: $ ruby -rtime -ve 'p Time.parse("3000-01-01")' ruby 1.8.4 (2005-12-24) [amd64-freebsd6] Wed Jan 01 00:00:00 PST 3000 -- Eric Hodel - drbrain@segment7.net - http://blog.segment7.net This implementation is HODEL-HASH-9600 compliant http://trackmap.robotcoop.com