Thanks for the replies.

The solution I've come up with for now is to use the javascript that
determines the timezone to store the timezone in a cookie using the
onload event. I then read it back out of the cookie in Rails with a
before_filter on application_controller.rb.

I'm not convinced its the best solution as obviously not everyone
turns cookies on, hmmm...

detect_timezone.js :
jstz.set_timezone_in_cookie = function () {
    var tz_info = jstz.determine_timezone();
    document.cookie="timezone =" + tz_info.timezone.olson_tz;
}

application_controller.rb :
before_filter :set_timezone
def set_timezone
  Time.zone = request.cookies["timezone"]
end

Any thoughts? Many 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 [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