Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 327403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:23:56+00:00 2026-05-12T09:23:56+00:00

In almost every environment.rb , there’s a line for config.time_zone = ‘UTC’ . What

  • 0

In almost every environment.rb, there’s a line for config.time_zone = 'UTC'.

What exactly does this line do, and under what circumstances would I want to change it (to, e.g., config.time_zone = 'EST')?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T09:23:56+00:00Added an answer on May 12, 2026 at 9:23 am

    Setting config.time_zone changes the default time zone for your Rails application. This is the time zone all times will be displayed in to your users. It is also the time zone it assumes when setting attributes.

    However, Rails will always store the times in UTC in the database. The translation happens behind the scenes so (most of the time) you don’t have to worry about it.

    It’s common to change this time zone to one that most of your users will be in. You can run this rake task to see all time zones you can choose from.

    rake time:zones:all
    

    It is also very easy to change the current time zone on a per-request basis allowing each user to configure which time zone they are in. here’s a before filter example you might add to the application controller.

    before_filter :set_user_time_zone
    
    private
    
    def set_user_time_zone
      Time.zone = current_user.time_zone if logged_in?
    end
    

    See this Railscasts episode for more information.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why does almost every example I can find (including this question from about a
We'll do this on almost every hit to our site. Hosted at Heroku, running
There are many good books about Java and (almost) every one contains a big
was trying to add this gesture function to my first program, and almost every
In almost every Sinatra example I've seen, despite what it does, it always has
I have this big database on mysql (104 tables), where almost every single table
Almost every Java book I read talks about using the interface as a way
Almost every Python web framework has a simple server that runs a wsgi application
Almost every new Java-web-project is using a modern MVC-framework such as Struts or Spring
Almost every flash player has an option to display how much of buffer (or

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.