I want to set the Time.zone to the user''s current time zone, I don''t want to store the timezone in user profile like many other solutions. How to do that? Thanks -- 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.
hmm.. doesn''t that come in the Request? Or maybe current_user.time_zone? Just a couple thoughts, I don''t really know. []''s Rodrigo Dellacqua On Sun, Jan 10, 2010 at 8:31 PM, Johnny Shi <johnny.t.shi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I want to set the Time.zone to the user''s current time zone, I don''t > want to store the timezone in user profile like many other solutions. > How to do that? > > Thanks > > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@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.
Correct me if i am wrong, but current_user.time_zone will require you store the time_zone under user profile. On Jan 10, 5:35 pm, Rodrigo Dellacqua <rgoyta...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> hmm.. doesn''t that come in the Request? > > Or maybe current_user.time_zone? > > Just a couple thoughts, I don''t really know. > > []''s > Rodrigo Dellacqua > > On Sun, Jan 10, 2010 at 8:31 PM, Johnny Shi <johnny.t....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I want to set the Time.zone to the user''s current time zone, I don''t > > want to store the timezone in user profile like many other solutions. > > How to do that? > > > Thanks > > > -- > > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@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.
2010/1/10 Johnny Shi <johnny.t.shi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> I want to set the Time.zone to the user''s current time zone, I don''t > want to store the timezone in user profile like many other solutions. > How to do that?I believe this has been discussed a number of times and my understanding is that the only way to achieve it is via javascript and pass the data back to to the server (or better just use it in the browser if possible). Google will provide various suggestions such as http://www.onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript 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.