From: Hal Fulton Date: 2004-03-21T04:04:47+09:00 Subject: Re: bug in Time, it wraps some dates to next month Sam Roberts wrote: > Maybe this is a feature, but I don't think so: > > [ensemble] ~/p/ruby/src/ruby $ ./ruby -e "p Time.local(2004, 'feb', 31, 1, 1, 1)" > Tue Mar 02 01:01:01 EST 2004 > > So it wraps into the next month if the day-of-month is past the end of > the month. Arguably a feature. > > But: > > [ensemble] ~/p/ruby/src/ruby $ ./ruby -e "p Time.local(2004, 'feb', 32, 1, 1, 1)" > -e:1:in `local': argument out of range (ArgumentError) from -e:1 > > It doesn't do it if the day-of-month is past 31? > > So, I think it is a bug, not a feature. > > [ensemble] ~/p/ruby/src/ruby $ ./ruby --version > ruby 1.8.1 (2004-03-20) [powerpc-darwin] I think (correct me if I'm wrong) this is related to the traditional behavior of the underlying C libraries. Thus perhaps both a bug and a feature. Hal