タイムゾーンの指定による時刻の変換 From http://d.hatena.ne.jp/tonkoh/20080901/1220287952
t = Time.at(1000000000) # => Sat Sep 08 21:46:40 EDT 2001
t.convert_zone("US/Pacific") # => Sat Sep 08 18:46:40 PDT 2001
time.convert_zone("US/Alaska") # => Sun Sep 08 17:46:40 AKDT 2001
t.convert_zone("UTC") # => Sun Sep 09 01:46:40 UTC 2001
t.convert_zone("Turkey") # = Sun Sep 09 04:46:40 EEST 2001
class Time
def convert_zone(to_zone)
original_zone = ENV["TZ"]
utc_time = dup.gmtime
ENV["TZ"] = to_zone
to_zone_time = utc_time.localtime
ENV["TZ"] = original_zone
return to_zone_time
end
end