From: Glenn Jackman Date: 2010-09-08T01:20:29+09:00 Subject: Re: convert date At 2010-09-07 01:47AM, "Ben Giddings" wrote: > On Sep 6, 2010, at 23:21, Pen Ttt wrote: > > 2.is there more simple way to change "oct" into 10? > > irb(main):004:0> dates = {"jan" => 1, "feb" => 2, "oct" => 10} > => {"oct"=>10, "jan"=>1, "feb"=>2} > irb(main):005:0> dates["oct"] > => 10 > or months = %w{jan feb mar apr may jun jul aug sep oct nov dec} num = months.find_index('oct') + 1 -- Glenn Jackman Write a wise saying and your name will live forever. -- Anonymous