From: noreply@... Date: 2006-08-02T15:14:48+09:00 Subject: [ ruby-Bugs-5263 ] strptime fails to properly parse certain inputs Bugs item #5263, was opened at 2006-08-01 23:14 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1698&aid=5263&group_id=426 Category: Standard Library Group: 1.8.x Status: Open Resolution: None Priority: 3 Submitted By: Michael Fischer (otterley) Assigned to: Nobody (None) Summary: strptime fails to properly parse certain inputs Initial Comment: Date.strptime and DateTime.strptime do not properly parse certain forms of input in which there are no non-numeric separators between the fields. For example, the following code fails: Date.strptime("20060401", "%Y%m%d") ArgumentError: 3 elements of civil date are necessary from /usr/local/lib/ruby/1.8/date.rb:650:in `new_with_hash' from /usr/local/lib/ruby/1.8/date.rb:675:in `strptime' from (irb):21 from /usr/local/lib/ruby/1.8/date.rb:1197 The following code, however, works as expected: x = Date.strptime("2006 04 01", "%Y %m %d") => # ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=1698&aid=5263&group_id=426