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

  • Home
  • SEARCH
  • 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 514579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:32:22+00:00 2026-05-13T07:32:22+00:00

Seems that when i create an object, the time is not correct. You can

  • 0

Seems that when i create an object, the time is not correct. You can see by the script/console output below. Has anyone encountered anything like this, or have any debugging tips?

 >> Ticket.create(...)
=> #<Ticket id: 7, from_email: "foo@example.com", ticket_collaterals: nil, to_email: "foo2@example.com", body: "hello", subject: "testing", status: nil, whymail_id: nil, created_at: "2009-12-31 04:23:20", updated_at: "2009-12-31 04:23:20", forms_id: nil, body_hash: nil>
>> Ticket.last.created_at.to_s(:long)
=> "December 31, 2009 04:23"
>> Time.now.to_s(:long)
=> "December 30, 2009 22:24"
  • 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-13T07:32:22+00:00Added an answer on May 13, 2026 at 7:32 am

    It’s the timezone issue. Time.now prints time in your local time zone while the rails is reporting it in UTC. See config/environment.rb, it will have config.time_zone = "UTC"

    >> Ticket.create(...)
    >> Ticket.last.created_at.utc
    => Thu, 31 Dec 2009 04:41:58 UTC +00:00
    >> Time.now.utc
    => Thu Dec 31 04:42:18 UTC 2009
    >> Time.now
    => Wed Dec 30 20:44:50 -0800 2009
    

    You can set the TimeZone in environment.rb to avoid confusion.

    # config/environment.rb
    config.time_zone = "Central Time (US & Canada)"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a windowless Ogre application, but it seems that the method
I need to create a log file containing HTML (tables, etc). It seems that
For my html form, it seems that I'm unable to create cross browser hover
It seems that we can show layers and even use a different zPosition for
I'm porting a program that had a very long loading time which was not
In Matlab class it seems to be syntactically correct to declare property that is
When saving an object by calling Entity.create(:name => Entity1) from the Rails console in
It seems that when a thread is created from within DllMain upon DLL_PROCESS_ATTACH it
i've created a video upload form and it seems that i get a limit
I have created branch with git checkout -b mybranch. It seems that something went

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.