From: Ammar Ali Date: 2010-10-16T20:53:49+09:00 Subject: Re: Is this an executable code? On Sat, Oct 16, 2010 at 2:40 PM, Kaye Ng wrote: > One more thing. > I typed this in IRB: > > epoch_time = Time.gm(2007, 5).to_i > t = Time.at(epoch_time) > > The second code returned: > 2007-05-01 08:00:00 +0800 > > Can anybody tell me why the "hour" value is 8? > I thought the default value for "hour" would be zeroes, as in this code: > Time.local(2010) > => 2010-01-01 00:00:00 +0800 The +0800 at the end of the output is a good clue. Time.at interprets the given seconds as local time, and you are 8 hours ahead of GMT. Regards, Ammar