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 9163517
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:27:58+00:00 2026-06-17T14:27:58+00:00

What is the difference between config.time_zone and config.local_zone ? Is there a situation when

  • 0

What is the difference between config.time_zone and config.local_zone? Is there a situation when should both be set?

  • 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-06-17T14:28:00+00:00Added an answer on June 17, 2026 at 2:28 pm

    1) config.time_zone

    Rails gives your ability to configure application time zone. It’s as easy as Time.zone = 'EST'.

    So setting config.time_zone in your application.rb will eventually do the same. And this is the right thing to do since we don’t want to depend on server time zone.

    In your application.rb (Rails 3) file, you can set the default timezone:

    config.time_zone = 'Central Time (US & Canada)'  
    

    2) config.local_zone

    It displays the system local time.

    So if you really must have local time in the db then lie to Rails by
    setting config.time_zone to UTC, this tells it that it is to assume
    that timestamps are already in UTC so it will not need to change them
    to get them into what it thinks is UTC.

    config.active_record.default_timezone determines whether to use Time.local (if set to :local) or Time.utc (if set to :utc) when pulling dates and times from the database. The default is :utc for Rails, although Active Record defaults to :local when used outside of Rails.

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

Sidebar

Related Questions

Difference between start-pointers and interior-pointers and in what situation we should prefer one over
In an Apache config file or a .htaccess file, is there any difference between
Possible Duplicate: What is the difference between app.config file and XYZ.settings file? I'm not
What is the difference between the customErrors and httpErrors sections of the web.config file
JAVA : is there a difference between the two references p && pp? PrintStream
Is there any tangible difference between the two forms of syntax available for creating
Is there any difference between ReferencePath with condition '%(CopyLocal)'=='true' and ReferenceCopyLocalPaths ? The question
What is the difference between osgi.startLevel and osgi.bundles.defaultStartLevel present in config.ini of equinox OSGI
Is there any difference between the following two lines of code in c# and
What is the difference between ${...} and !{...} in the Spark View Engine? There

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.