On 14 Apr 2010, at 10:38, Colin Law wrote:

Rails is timezone aware, so that isn't all too much of a problem, as you can
find in the RoR wiki: http://wiki.rubyonrails.org/howtos/time-zones
There are however ways to determine the timezone of the user without him/her having to enter it into a form. Basically, you determine the timezone offset
using Javascript, as details
on 
http://www.onlineaspect.com/2007/06/08/auto-detect-a-time-zone-with-javascript/

Does this work reliably?  I was under the impression that it was
generally agreed that there is no reliable way to do this.

It works as reliably as you can expect user client data to be. It can make an educated guess, if you assume the user has set his/her timezone correctly in the OS. It should be quite OK these days though, since most users will be using NTP to set their time. In the end, the same rule as always should apply here: never trust user entered data. But the same would apply if you'd have the user himself choosing the timezone in a popup.


Best regards

Peter De Berdt

--
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to