From: Alin Popa Date: 2007-06-27T14:45:10+09:00 Subject: Re: DateTime problem Cool Wong wrote: > DateArray = ["Apr", "2", "2007"] > > How can i read the month and year in the array??? > > The OUTPUT: > day = 01 > month = 04 > year = 07 Hi, For me worked like that: tt = Time.parse(da.join(" ")) day = tt.strtime("%d") month = tt.strftime("%m") year = tt.strftime("%y") print "\nday #{day}"\ "\nmonth #{month}" "\nyear #{year}"\ "\n" Best regards, Alin -- Posted via http://www.ruby-forum.com/.