How to display a DateTime in the timezone of a browser using Rails?

datetime, ruby-on-rails, ruby-on-rails-3, ruby-on-rails-3.2, timezone

Solution

Someone has made the solution into a gem:

https://github.com/basecamp/local_time

Problem

Rails stores all `DateTime`s in the UTC timezone. I need to display that time now to the user in the timezone that their browser reports they're in. Is there an easy way to do this? Using latest Rails (3.2.13).

Original source

Related problems