In Ruby 1.87 I could do:
Date.parse (\"3/21/2011\")
Now in 1.9.2 I get:
<ArgumentError: invalid date
Per this bug report, the ability to parse mm/dd/yy
dates was intentionally removed in 1.9. Ruby's creator, Yukihiro Matsumoto says:
"dd/dd/dd" format itself is very culture dependent and ambiguous. It is yy/mm/dd in Japan (and other countries), mm/dd/yy in USA, dd/mm/yy in European countries, right? In some cases, you can tell them by accident, but we should not rely on luck in general cases. I believe that is the reason parsing this format is disabled in 1.9.
As hansengel suggests, you can use Date.strptime
instead.