johnhutch
2007-Nov-04 06:33 UTC
Localized time -- Is there any way I can get the users''s time zone?
I''m trying to avoid making my users enter a time zone in order to have posts and updates displayed in their time. Is there *any* way I can figure out what the user''s current time is so I can add/subtract all the times I''m outputting accordingly? --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Steve
2007-Nov-04 15:01 UTC
Re: Localized time -- Is there any way I can get the users''s time zone?
On Sun, 04 Nov 2007 06:33:46 +0000, johnhutch wrote:> I''m trying to avoid making my users enter a time zone in order to have > posts and updates displayed in their time. Is there *any* way I can > figure out what the user''s current time is so I can add/subtract all > the times I''m outputting accordingly?You can use JavaScript to pull their timezone information when they first hit your site. If they''re logging in, then you could just set a hidden form field. If there''s no logging in, then you could use a remote form call. Steve --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
gene tani
2007-Nov-04 17:34 UTC
Re: Localized time -- Is there any way I can get the users''s time zone?
On Nov 4, 7:01 am, Steve <vertebr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Sun, 04 Nov 2007 06:33:46 +0000, johnhutch wrote: > > I''m trying to avoid making my users enter a time zone in order to have > > posts and updates displayed in their time. Is there *any* way I can > > figure out what the user''s current time is so I can add/subtract all > > the times I''m outputting accordingly? > > You can use JavaScript to pull their timezone information when they first > hit your site. If they''re logging in, then you could just set a hidden > form field. If there''s no logging in, then you could use a remote form > call. > > Stevetake a look at this (one of the more entertainign README''s of this or any time) http://svn.rubyonrails.org/rails/plugins/tztime/README --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---