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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:55:34+00:00 2026-05-31T02:55:34+00:00

Normally, Rails stores all times in the database in UTC time. If you set

  • 0

Normally, Rails stores all times in the database in UTC time. If you set your time zone to be something else, it converts automatically between that zone and UTC when you save to the database or retrieve from it.

What are some of the advantages of this approach? Are there any disadvantages? Is there any way to have Rails use a different time zone?

I think some of the advantages may be:

  • UTC removes the ambiguities of seasonal time changes
  • You can present different time zones to different users while keeping things consistent in the database

The only disadvantage I can think of is that, for an internal app where all users are actually in the same time zone, this difference makes it harder to run raw SQL queries based on local time.

  • 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-31T02:55:36+00:00Added an answer on May 31, 2026 at 2:55 am

    This question has a little bit of a religious feel to it, but I’m going to answer it based on my personal experience.

    Always store dates in an unambiguous form. Storing the date in UTC is pretty much the standard in that regard.

    Advantages:

    • You can do simple math on date-times in the database without needing to convert them.
    • You can adjust the display of the dates at the presentation layer
    • Web applications can use a little bit of javascript to display local time

    Disadvantages:

    • You need to convert all the times into some ‘local’ time on display
    • Localtime <-> UTC conversions incur a small processing penalty

    Can you get rails to do something different? Possibly, but I’ve never tried as it just was too much work to fight what IMHO was a sensible design.

    Does it make sense to use UTC from a ‘just use my timezone’ sense? Yes. Your server could be in California, your users in New York and who decides what is local time in that case. The server? The users? Mike, who just happens to be in London for the week on a business trip? In this case what timezone do you use?

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

Sidebar

Related Questions

Normally I would set the pool size as development: adapter: postgresql encoding: unicode database:
So normally I use the date_select helper in my Rails applications in my Models'
Normally all the document related to an iOS application are stored in a document
I'm writing a Ruby on Rails app that normally runs on Heroku or a
After my upgrade to Rails 3.1.3 and Ruby 1.9.3 (via RVM) i can't normally
I'm uploading a file to the server in Ruby on Rails Normally, it's a
I'm looking for Rails plugin that can store image file to database. I've just
Normally I use: gem install rails I can install Rails on Windows, but by
I normally use Ruby on rails to develop my work with sublime text as
I went to scale my Heroku rails app, like I normally do, but WHAM!

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.