2012/2/10 Yui NARUSE <naruse / airemix.jp>:
> The time class seems to accept any number from 1-31 as a valid day for any month of the year, even if the month has less than 31 days. If the day exceeds the number of days, it just spills over into the following month; "2012-02-30" become "2012-03-01", "2012-04-31" becomes "2012-05-01", and so on. It's not until you try 32 as a day number that you get the expected Argument Error. This happens with Time.new, Time.parse, Time.local, Time.utc, etc.
Once, we tried to check time validity by testing round tripness.
[ruby-core:14517]
But it was too strict. So we abondon the test.
[ruby-dev:33086]
If people really need strict Time constructors,
new methods (Time.strict_local, Time.strict_utc, etc.) should be considerd.
--
Tanaka Akira