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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:03:57+00:00 2026-05-30T17:03:57+00:00

At first: thats not issue of wrong zone. In irb and database everything is

  • 0

At first: thats not issue of wrong zone. In irb and database everything is fine. Problem occurs when I want to display dates (created_at, updated_at and all defined by myself in every model) in my views. I was trying to set time zone in application.rb and remove time formats from initializers and that didn’t solved my issue.

schema information generated by Annotate gem:

#  created_at                      :datetime
#  updated_at                      :datetime
#  publish_at                      :datetime

from irb:

1.9.2-p290 :004 > Time.zone
 => (GMT+00:00) UTC 
1.9.2-p290 :005 > Time.zone.now
 => Fri, 24 Feb 2012 12:14:04 UTC +00:00 
1.9.2-p290 :006 > Time.now
 => 2012-02-24 13:14:07 +0100

Examples:

1.9.2-p290 :007 > Article.last
  Article Load (0.3ms)  SELECT `articles`.* FROM `articles` ORDER BY `articles`.`id` DESC LIMIT 1
 => #<... created_at: "2012-02-24 12:04:24", updated_at: "2012-02-24 12:04:24", publish_at: "2012-02-24 12:04:24"...> 

App displays:

Created_at 2012-02-24 12:02,
Updated_at 2012-02-24 12:02,
Publish_at 2012-02-24 12:02,

1.9.2-p290 :008 > Article.first
  Article Load (0.5ms)  SELECT `articles`.* FROM `articles` LIMIT 1
=> #<...created_at: "2012-01-30 10:28:07", updated_at: "2012-02-08 17:20:41", publish_at: "2012-02-08 17:20:33"...> 

App displays:

Created_at 2012-01-30 10:01,
Updated_at 2012-02-08 17:02,
Publish_at 2012-02-08 17:02

this applies whole app (including active_admin)

Sorry for my English 😉 Any ideas what is the reason of my problem?

  • 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-30T17:03:58+00:00Added an answer on May 30, 2026 at 5:03 pm

    I’ve got it 🙂 That was silly, but maybe someone will need reminder: App gets format from locale yml file first (thats only way to set date format in active admin; formats from initializers doesn’t matter):

    time:
      formats:
        default: "%Y-%m-%d"
        short: "%b %d"
        long: "%Y-%m-%d %H:%m"
    

    and ofc minutes in long format should be %M (not %m)

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

Sidebar

Related Questions

First thing i want to say that it's not an easy question to explain,
First off I want to say that I am not using threads or multiple
First of all, I want to be clear that I'm not talking about defining
THE EXAMPLE First and foremost, here's my code and problem: http://www.nathanstpierre.com/MBX/showoff.html THE ISSUE So
It's not that noticeable at first, but my counter skips over to zero and
First I must say that I'm not good at English and completely new to
this is my first question here :) I know that I should not check
First of all, I know that UDP is not a reliable protocol but I
First off, let me start off that I am not a .net developer. The
i need to work with setTimeout function but that function does not work. First

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.