From: Sam Roberts Date: 2004-03-21T05:09:52+09:00 Subject: Re: bug in Time, it wraps some dates to next month Quoteing hal9000@hypermetrics.com, on Sun, Mar 21, 2004 at 05:00:43AM +0900: > Sam Roberts wrote: > >You're correct that mktime() allows outofrange values (I didn't know > >that, is it standard?), an example from my man page is > > > > For example, October 40 is changed into November 9, > > > >But the second example shows Time doesn't allow this traditional usage! > > Oh, I see what you mean. Maybe some of this behavior needs to be > standardized. > > I think I remember one scenario where it did allow this type of > thing, but I could be wrong. Maybe the 11-value array or whatever? 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 Sam