hey guys,
i''ve got a problem and i really don''t know how to solve it.
when i''m creating a new dataset in my application, the created_at and
updated_at time will be saved in UTF Time (+000).
in my environment.rb i set the following line:
config.time_zone = ''Berlin''
when i''m using the console (script/console) for reading out some
example
dataset, the created_at and updated_at timestamp will be shown like
this:
Thu, 14 Apr 2011 08:27:04 CEST +02:00
this is correct, because you have to add 2 hours to get the time in
berlin.
but if i read out the datasets in my application and show them in the
views, no hours will be added to the UTF Times saved in the database.
i don''t know why it works in the console but not while executing the
application.
please help me!
Tobias
--
Posted via http://www.ruby-forum.com/.
--
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.
Try adding this to environment.rb config.active_record.default_timezone = :local 2011/4/14 Tobias H. <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>> hey guys, > > i''ve got a problem and i really don''t know how to solve it. > when i''m creating a new dataset in my application, the created_at and > updated_at time will be saved in UTF Time (+000). > in my environment.rb i set the following line: > config.time_zone = ''Berlin'' > when i''m using the console (script/console) for reading out some example > dataset, the created_at and updated_at timestamp will be shown like > this: > > Thu, 14 Apr 2011 08:27:04 CEST +02:00 > > this is correct, because you have to add 2 hours to get the time in > berlin. > but if i read out the datasets in my application and show them in the > views, no hours will be added to the UTF Times saved in the database. > > i don''t know why it works in the console but not while executing the > application. > > please help me! > > > Tobias > > -- > Posted via http://www.ruby-forum.com/. > > -- > 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. > >-- 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 Apr 14, 8:05 am, "Tobias H." <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> hey guys, > > i''ve got a problem and i really don''t know how to solve it. > when i''m creating a new dataset in my application, the created_at and > updated_at time will be saved in UTF Time (+000). > in my environment.rb i set the following line: > config.time_zone = ''Berlin'' > when i''m using the console (script/console) for reading out some example > dataset, the created_at and updated_at timestamp will be shown like > this: > > Thu, 14 Apr 2011 08:27:04 CEST +02:00 > > this is correct, because you have to add 2 hours to get the time in > berlin. > but if i read out the datasets in my application and show them in the > views, no hours will be added to the UTF Times saved in the database. >How are you displaying them? Fred> i don''t know why it works in the console but not while executing the > application. > > please help me! > > Tobias > > -- > Posted viahttp://www.ruby-forum.com/.-- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> How are you displaying them? > > Fredin the view with: <%= l @execution.created_at %> the l means in this case, that i format the date in german notation. greetz, tobias -- Posted via http://www.ruby-forum.com/. -- 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 Apr 14, 9:13 am, "Tobias H." <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> > How are you displaying them? > > > Fred > > in the view with: > <%= l @execution.created_at %> > > the l means in this case, that i format the date in german notation. >Dumb question: did you restart the server after setting config.time_zone ? Fred> greetz, tobias > > -- > Posted viahttp://www.ruby-forum.com/.-- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.