From: Rob Biedenharn Date: 2007-03-06T03:12:02+09:00 Subject: Re: Excel date conversion On Mar 5, 2007, at 9:38 AM, WKC CCC wrote: > Is there a way to convert the excel date number i.e. 34516 into a > datestring: 01-Jul-94 > > Thanks >> require 'data' => true >> class Numeric >> def to_excel_date >> Date.new(1899,12,30) + self.to_i >> end >> end => nil >> 34516.to_excel_date => # >> 34516.to_excel_date.strftime("%d-%b-%y") => "01-Jul-94" If that's not quite right, the trick is to find out what date Excel says is 0 and add that julian date (Date#jd) to the value you want and then you manipulate the Ruby Data object as needed. -Rob Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com