From: matz@... (Yukihiro Matsumoto) Date: 2004-03-22T01:45:22+09:00 Subject: Re: bug in Time, it wraps some dates to next month Hi, In message "bug in Time, it wraps some dates to next month" on 04/03/21, Sam Roberts writes: |[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. This is caused by rather stupid (but simple) date range check. I'm not sure what is the best way. No check? Or strict check? Discussion welcome. matz.