Posts with the tag: rails

Times & Dates in web browser timezone with Ruby on Rails 6.0

Read in 2 minutes ·

With Ruby on Rails 6, I like to have times and dates presented in the user’s timezone. Basecamp’s local_time My first search results lead me to Basecamp’s local_time ruby gem for Ruby on Rails. It makes it easy to display times and dates in the local timezone of the user. Ruby on Rails renders times and dates to <time> elements in UTC timezone. User-agent JavaScript converts those to the local timezone of the user’s web browser.