In ruby, how can I get current time in a given timezone? I know the offset from UTC, and want to get the current time in the timezone with that offset.
Just add or subtract the appropriate number of seconds:
>> utc = Time.utc(2009,5,28,10,1) # given a utc time => Thu May 28 10:01:00 UTC 2009 >> bst_offset_in_mins = 60 # and an offset to another timezone => 60 >> bst = t + (bst_offset_in_mins * 60) # just add the offset in seconds => Thu May 28 11:01:00 UTC 2009 # to get the time in the new timezone