From: Glenn Jackman Date: 2009-09-17T03:20:07+09:00 Subject: Re: import utc in Time At 2009-09-16 12:12PM, "Luca Roma" wrote: > Hi, i'm using facebooker for receiving facebook's events. > I receive the time of the event in utc format. > > how can i import it in a Time object > > in other words > > a= Time.now.utc > > how can i import a in a Time object?? > > this not works > Time.parse(a) The ActiveSupport gem has a time zone class: require 'active_support' utc = Time.now.utc # => Wed Sep 16 17:28:58 UTC 2009 utc.class # => Time zone = ActiveSupport::TimeZone['Eastern Time (US & Canada)'] eastern = zone.at(utc.to_f) # => Wed, 16 Sep 2009 13:28:58 EDT -04:00 eastern.class # => ActiveSupport::TimeWithZone -- Glenn Jackman Write a wise saying and your name will live forever. -- Anonymous