From: Robert Klemme Date: 2011-01-20T17:14:16+09:00 Subject: Re: How to reference a different epoch. On Thu, Jan 20, 2011 at 6:51 AM, Phil Henley wrote: > I'm trying to use the 'at' method in Time on some data pulled from an > OSX file: > > Time.at(317192535.56501901) > > And my result is off by 30 years.  I assume this is because Ruby is > referencing the Unix epoch of 1/1/1970 and I need to reference the OSX > epoch of 1/1/2000.  Is there an easy way to change this so I'm > referencing the OSX epoch? That seems fairly easy irb(main):001:0> OSX_EPOCH = Time.new(2001,1,1).to_i => 978303600 irb(main):002:0> Time.at(317192535.56501901 + OSX_EPOCH) => 2011-01-20 05:02:15 +0100 Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/