Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
$ irb 1.9.3-p429 :001 > require 'date' => true 1.9.3-p429 :002 > Date.strptime('04/08/13' , '%m/%d/%Y').strftime('%Y-%m-%d') => "0013-04-08"
なんらかの理由で、2013年ではなく0013と表示されています。:)
You have format with small mistake, it should be %m/%d/%y
%m/%d/%y
Date.strptime('04/08/13', '%m/%d/%y').strftime('%Y-%m-%d') => "2013-04-08"