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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:37:16+00:00 2026-05-23T20:37:16+00:00

When i am trying to use Time.zone.now it gives me an error which shows

  • 0

When i am trying to use Time.zone.now it gives me an error which shows that Time.zone is nill because i did not mentioned config.time_zone in my environment file and when i am doing , my server is not getting started and giving me an error.

initialize_time_zone’: Value assigned to config.time_zone not recognized.Run “rake -D time” for a list of tasks for finding appropriate time zone names. (RuntimeError)

I am using
rails -v Rails 2.3.11
ruby -v ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
rvm -v rvm 1.6.23 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]

* LOCAL GEMS *

actionmailer (2.3.11)
actionpack (2.3.11)
activerecord (2.3.11)
activeresource (2.3.11)
activesupport (2.3.11)
archive-tar-minitar (0.5.2)
bluecloth (2.1.0)
builder (3.0.0)
columnize (0.3.4)
escape (0.0.4)
fastercsv (1.5.4)
hpricot (0.8.4)
linecache19 (0.5.12)
mime-types (1.16)
mysql (2.8.1)
nokogiri (1.5.0)
pr_geohash (1.0.0)
rack (1.1.2)
rails (2.3.11)
rake (0.8.7)
RedCloth (4.2.7)
rsolr (0.12.1)
ruby-debug-base19 (0.11.25)
ruby-debug19 (0.11.6)
ruby_core_source (0.1.5)
sunspot (1.2.1)
sunspot_rails (1.2.1)
will_paginate (2.3.15)

Thanks
Nishant


If we are not mentioning the Time.zone in the environment file , it will be UTC by default. I have mentioned config.active_record.default_time zone as :utc and this was working fine in ruby 1.8.7 but when i have changed that to ruby 1.9.2 its causing problems.

  • 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-23T20:37:16+00:00Added an answer on May 23, 2026 at 8:37 pm

    You have to set explicitly your time zone in you config file if you want to use Time.zone. There seems to be no default value.

    In config/environment.rb:

    Rails::Initializer.run do |config|
        config.time_zone = 'UTC'
    end
    

    To get a list of all available time zones with their UTC offset run

    rake time:zones:all
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use curses.h library for the first time, but no matter which
I'm trying to use Go package time to benchmark a function in my program.
I'm trying to use aspectj with compile time weaving to support annotations like Spring's
I'm trying to use an event listener for the first time. All samples I've
this is my first time trying to use document classes in AS3 and im
I'm trying to use the Timespan class to create a start time and a
I am trying to use the Google generated API library for the first time
I am trying to use matplotlib to create a graph to reflect real time
I've used ITK with c++ some time ago and I'm trying to use simple
I am using HMVC codeigniter. I am trying to use jquery ajax first time.

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.