Created
November 2, 2010 09:55
-
-
Save macbury/659437 to your computer and use it in GitHub Desktop.
Facebook Time zone in Rails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def prepareFBTime(time) | |
local_offset = Time.new.utc_offset | |
date = Time.at(time.to_i).in_time_zone('America/Los_Angeles') | |
Time.at(date.to_i - date.utc_offset * 2 + local_offset) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment