On Thu, Jan 08, 2004 at 03:32:02AM +0900, Daniel Carrera wrote:
> Sorry to reply to my own post, but by trial and error I think I found it.
> Time.at takes the number of seconds since the epoch, right?

Right.

> So, to figure out the mid point of the Epoch I simply use:
> 
> >> Time.at(2**30).utc
> => Sat Jan 10 13:37:04 UTC 2004

Yup!  It surprises me the number of times as a sysadmin I needed to know
what real-world time a time_t value corresponded to; most things translate
and hide that from the user, but it kept cropping up.  Before Ruby, I would
use something like this (e.g. to find out when the decimal representation
of the second count "rolled over" to 1,000,000,000 a couple years ago,
which was Sunday, September 9, 2001, at 01:46:40 UTC):

        $ perl -e 'print scalar localtime 10**9,"\n"'   # local time
        $ perl -e 'print scalar gmtime 10**9,"\n"'      # UTC

But now I use:

        $ ruby -e 'puts Time.at(10**9)'                 # local time
        $ ruby -e 'puts Time.at(10**9).utc'             # UTC

Not only does it feed my growing preference for Ruby over Perl, it's
even less typing. :)

> > Is UTC the same as Greenwich Mean Time?

Short answer: yes.  Long answer: "no, but . . . " :)

See the links provided in the other answer for exhausting detail, but
the main practical difference is that prior sometime in the 1920s,
0 hours GMT was NOON rather than midnight (for the convenience of astronomers,
to keep the date from changing in the middle of their "workday").  So 
when historical data - or new data about events long in the past - includes a
GMT timestamp, it's not always which time the given hour is counted from.  
Whereas UTC is defined to start at midnight no matter how far back in time you
use it.  For instance, the first new moon of the Hebrew calendar era was 
in the Julian calendar BCE 3761 October 6 at 20:50:20 UTC.  Documents written
about the Hebrew calendar in the last century would be likely to label
that time 08:50:20 GMT, while documents written between World War II and
the Vietnam War, say, would label it 20:50:20 GMT.  Unless you know when a
document was written, you don't know what GMT means.

-Mark