Use strptime
and give a specific time format.
ruby-1.9.2-p136 :022 > Date.strptime '03/21/2011', '%m/%d/%Y'
=> #<Date: 2011-03-21 (4911283/2,0,2299161)>
See michaelmichael‘s response for the reason for this difference between Ruby versions.
Use strptime
and give a specific time format.
ruby-1.9.2-p136 :022 > Date.strptime '03/21/2011', '%m/%d/%Y'
=> #<Date: 2011-03-21 (4911283/2,0,2299161)>
See michaelmichael‘s response for the reason for this difference between Ruby versions.