jeremyevans / home_run

Fast Date/DateTime classes for ruby :: Unmaintained, unnecessary on ruby 1.9.3+
Other
465 stars 10 forks source link

DateTime.strptime fails #9

Closed deepfryed closed 14 years ago

deepfryed commented 14 years ago

DateTime.strptime("20100304", "%Y%m%d") should parse but getting `strptime': invalid date (ArgumentError)

using 0.9.0, on ruby 1.9.1p378 (2010-01-10 revision 26273) [x86_64-linux]

jeremyevans commented 14 years ago

Definitely a bug that will be fixed, though fixing it will mean that you can't parse a date with a year after 9999 using strptime.

jeremyevans commented 14 years ago

Fix strptime for %Y%m%d and similar formats (Closed by 44ef76e2deb083605215075cbd6d01e404b4dbe9)

Previously, strptime grabbed an arbitrary number of digits for the %Y and %G formats. Now it operates like the standard library, checking to see if %Y or %G is followed by a numeric literal or format, and restricting the number of digits to 4 if so.

deepfryed commented 14 years ago

cheers