Skip to content

Instantly share code, notes, and snippets.

@macbury
Created November 2, 2010 09:55
Show Gist options
  • Save macbury/659437 to your computer and use it in GitHub Desktop.
Save macbury/659437 to your computer and use it in GitHub Desktop.
Facebook Time zone in Rails
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