Is it possible to set a person''s time zone based on their IP or some other factor than specifying their time zone? -- 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-/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 -~----------~----~----~----~------~----~------~--~---
Hi Ben, Ben Johnson wrote:> Is it possible to set a person''s time zone based on their IPNot with any degree of certainty. IP addresses are not ''handed out'' based on geographic location.> or some other factor than specifying their time zone?The decision about the time zone a particular spot on the earth will use is a political one. There are states in the US, for example, that do not use Daylight Savings Time. So clocks within some states within the Central Time Zone will be set to CST while others will be set to CDT. It gets worse. If you really want to know what time zone a visitor is in, you need to ask. hth, Bill --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Bill is absolutely right. You can guess the users location based on their IP but not precise enough. The only way that will be satisfactory is to ask the user for that kind of information. The alternative way will be to use a little javascript function that will collect users UTC offset using getTimezoneOffset(). You can make use of AJAX to update the UI and to collect this kind of info. But the main thing is why do you need this kind of information? On Jun 16, 6:26 pm, "Bill Walton" <bill.wal...-xwVYE8SWAR3R7s880joybQ@public.gmane.org> wrote:> Hi Ben, > > Ben Johnson wrote: > > Is it possible to set a person''s time zone based on their IP > > Not with any degree of certainty. IP addresses are not ''handed out'' based > on geographic location. > > > or some other factor than specifying their time zone? > > The decision about the time zone a particular spot on the earth will use is > a political one. There are states in the US, for example, that do not use > Daylight Savings Time. So clocks within some states within the Central Time > Zone will be set to CST while others will be set to CDT. It gets worse. > > If you really want to know what time zone a visitor is in, you need to ask. > > hth, > Bill--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---