From: Robert Klemme Date: 2007-03-13T04:05:06+09:00 Subject: Re: new Date from Time.now().to_a On 12.03.2007 02:27, Aaron Smith wrote: >> ms = 1173658884500.0 >> nd = Time.at( ms.to_f / 1000.0 ) >> #puts nd >> #puts nd.to_a.inspect >> f = nd.to_a >> n = Date.parse("#{f[4]}-#{f[3]}-#{f[5]} #{f[1]}:#{f[2]}:#{f[3]} >> #{f[9]}") >> #puts n >> #puts n.class > > correction: Date.parse("#{f[3]}-#{f[4]}-#{f[5]} #{f[1]}:#{f[2]}:#{f[3]} > #{f[9]}") Why the parsing? irb(main):042:0> t=Time.now => Mon Mar 12 19:59:33 +0100 2007 irb(main):043:0> d=Date.new(t.year, t.month, t.day) => # irb(main):044:0> d.strftime => "2007-03-12" Kind regards robert