Ruby's Time.parse()
works for dates from Dec 14 1901 up Jan 18 2038 (this appears to be system dependent):
# works
irb(main):038:0> Time.parse('14-12-1901')
=> Sat Dec 14 00:00:00 -0600 1901
# doesn't work
irb(main):039:0> Time.parse('13-12-1901')
ArgumentError: time out of range
from /usr/lib/ruby/1.8/time.rb:184:in `local'
from /usr/lib/ruby/1.8/time.rb:184:in `make_time'
from /usr/lib/ruby/1.8/time.rb:243:in `parse'
from (irb):39
from /usr/lib/ruby/1.8/date/format.rb:214
I can't think of the reason why it stops working there. Why the odd cut-off? How can I programatically get the valid range?