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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:30:23+00:00 2026-05-19T14:30:23+00:00

I just added a field time_zone to my user model and filled it with

  • 0

I just added a field time_zone to my user model and filled it with UTC + 01:00 and, on a second try, with ‘Bern’ just to test things.

Before I set this time zone thing, calls in a view like l @date, :format => :short were no problem because it took the format from my {locale}.yml file. But now, after adding time_zone, rails is looking for a {time_zone}.yml file for date conversion formats.

I don’t see the real sense behind this. I know that different countries display dates and times in a different way than others. But is creating a file for each time zone the right solution, especially when a lot of time zones will have the same display format? I don’t think this is DRY.

However, I need to work with time zones because dates are wrong displayed. How can I keep the behaviour of working with {locale}.yml files and… just define a time zone which converts dates displayed to the right value?

  • 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-19T14:30:23+00:00Added an answer on May 19, 2026 at 2:30 pm

    One possible solution would be creating the {time_zone}.yml files as links to the {locale}.yml files, so you only have to maintain one file instead of two (I’m assuming that the fields needed for {time_zone}.yml are present in {locale}.yml)

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

Sidebar

Related Questions

I just added an ExecutionHandler to my server pipeline just before my main business
here's a tricky question... I have default styled input fields (no css added, just
I just added this to my web.xml on my JBOSS server. But it had
I just added PrimeFaces 3.0 to a JSF project: <repository> <id>prime-repo</id> <name>PrimeFaces Maven Repository</name>
i just added a launch image to an application i wrote. According to several
I just added adds to my app, but the moment i run it i
I just added the GreenDroid Library into my Application. I extended the startview with
I just added a Facebook like button to my website, just the most basic
I've just added yet another 3rd-party component to my .net project that contains a
I have just added a Core Plot view to my application based on a

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.