From: Kamarulnizam Rahim Date: 2011-02-03T14:31:02+09:00 Subject: Re: Converting date format (CSV to yaml) I used both method. Both of them return an error cdate = due_date m, d, y = cdate.split('/').map{|i| if i.length == 1 then "0#{i}" else i end} puts ydate = "#{y}-#{d}-#{m}" date = Date.parse(ydate) #date = Date.strptime(ydate, '%d/%m/%Y') C:/Ruby192/lib/ruby/1.9.1/date.rb:1022:in `new_by_frags': invalid date (ArgumentError) from C:/Ruby192/lib/ruby/1.9.1/date.rb:1066:in `parse' cdate = due_date m, d, y = cdate.split('/').map{|i| if i.length == 1 then "0#{i}" else i end} puts ydate = "#{y}-#{d}-#{m}" #date = Date.parse(ydate) date = Date.strptime(ydate, '%d/%m/%Y') C:/Ruby192/lib/ruby/1.9.1/date.rb:1022:in `new_by_frags': invalid date (ArgumentError) from C:/Ruby192/lib/ruby/1.9.1/date.rb:1046:in `strptime' Is it because of my IDE? Nizam -- Posted via http://www.ruby-forum.com/.