From: Hal Fulton Date: 2004-03-21T05:20:09+09:00 Subject: Re: bug in Time, it wraps some dates to next month Sam Roberts wrote: > Possibly you are thining of Date.new(), which allow negative months, and > negative daysofmonths, like the C mktime()? However, it doesn't allow > out of range values: > > [ensemble] ~/p/ruby/vcard $ ruby -rdate -e "p Date.new(2004, 2, 29).to_s" > "2004-02-29" > [ensemble] ~/p/ruby/vcard $ ruby -rdate -e "p Date.new(2004, 2, 30).to_s" > /usr/lib/ruby/1.6/date.rb:147:in `new3': invalid date (ArgumentError) > from -e:1 Personally I think I'd like to reduce our dependence on the C lib. I think I'd like to see an exception or at least a nil return value for (e.g.) Feb 29, 2005 or November 31 of any year. I wonder if this would break any existing code? Probably something internal in Time/Date/DateTime would break. Matz? Opinion? Hal