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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T08:22:23+00:00 2026-05-17T08:22:23+00:00

We got a Rails 3 Server based on Ruby 1.9.2 running on a MYSQL

  • 0

We got a Rails 3 Server based on Ruby 1.9.2 running on a MYSQL DB and Problems with the time.now and time.zone.now setting.

For better explaination we assuse its 13:00 UTC right now.

  • Ubuntu Systemtime is set to 15:00 UTC +02:00 (Thats CEST (Central European Summertime) and is correct for our Timezone).

  • The Rails time (time.now) is set to 13:00 +0200

  • the time.zone.now is set to CEST
  • MYSQL Global time and Session time are both set to SYSTEM

now we create a new entry in the MYSQL DB (via activerecord) which has a timestamp.

but when we look at the timestemp its -2 hours offset to the current server time (in our example 11:00)

We tried setting the time.zone to a very different one for testing propose, it had absolutly no effect on a new mysql entry.
Also we tried to set the mysql global time and session time to UTC, no effect.

The only thing we can imagene right now what could be the problem is that the time.now is taking effect on the mysql entry and is set wrong. Problem here: we’re unable to set the time.now setting. But even if that would be possible somehow (is it?), dunno if that fixes the problem.

Did anyone ever have such a problem or any ideas what could cause it?

  • 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-17T08:22:25+00:00Added an answer on May 17, 2026 at 8:22 am

    There are two things to configure for rails.

    1. The current timezone which you’ve done (used in Time.zone.now), this sets the timezone for timestamps in the instantiated records you load.

    2. The timezone that those values are converted to when stored to the db. This should be set to the same timezone as your system/mysql.
      I think this option is configured via: ActiveRecord::Base.default_timezone = :utc

    Since your system time is set to CEST, you’ll want to use the same value for that as well.

    The reason there are two config options is incase you’ve got users in multiple timezones (international audience), then Time.zone can be set differently for each logged in user, and the db timezone will convert correctly to the Time.zone timezone.

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

Sidebar

Related Questions

I've got a standard Rails app with Nginx and Mongrel running at http://mydomain .
We have a Ruby-on-rails server-side deployment that needs to allow users to download a
I've been updating my user test server and now suddenly I got an error
i'm currently using mongrel server running rails2.3.5 with ruby1.8, and got this odd behavior:
Since I've migrated from Leopard to Snow Leopard I get $ ruby script/server Rails
I downloaded, setup all the gems for http://github.com/bestbuyremix/BBYIDX Now when I type: rails script/server
I've got my Rails (2.1) app setup to send email via Gmail, however whenever
I've got a rails application where users have to log in. Therefore in order
I've got the following situation A rails application that makes use of rjs /
I've got a really simple rails question here but I can't seem to find

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.