... which is the number of seconds since midnight, Jan 1, 1970 IN A
SPECIFIC TIME ZONE (in this case, Pacific). Assuming I know the time
zone (I actually don't -- see PS below), how to I convert this into a
Ruby time object? I could fudge by adding the number of seconds in the
time zone offset, but that seems suspect.
- ff
P.S.: Even if I know that 1325376000 is given in Pacific Time, I don't
know a-priori if that's UTC-0800 or UTC-0700 because of daylight savings
time. If there's an easy way to take that into account, that would be
nifty.
I dug down into the xls code and it appears that they're ignoring
timezones altogether. Since a billing interval of "midnight to
midnight" is always in the context of the local time, this is probably a
reasonable approach.
Now that I think about it, I could just adopt that technique as well, in
which case I can always coerce to UTC:
t = Time.at(1325376000).to_datetime.new_offset("00:00")