Hello guys, I am using ruby 1.9.2-p290 and rails 2.3.11 and when i am trying to run Time.zone in my console it is showing me nil and when i am trying to mention it in the environment.rb file by config.time_zone = ''UTC'' it is showing me an error .rvm/gems/ruby-1.9.2-p290/gems/rails-2.3.11/lib/initializer.rb:561:in `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 have also mentioned these two things in my environment.rb file config.active_record.default_timezone = :utc and ENV[''TZ''] = ''UTC'' -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 20 July 2011 11:52, nishant <nishantnigam5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello guys, > > I am using ruby 1.9.2-p290 and rails 2.3.11 and when i am trying to > run Time.zone in my console it is showing me nilzone is an instance method of Time, not a class method. Therefore you cannot say Time.zone, but you can say t = Time.now t.zone See http://www.ruby-doc.org/core/classes/Time.html#M000373 Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.