Sunday, August 28, 2011

[Rails] Re: Local timezone issues

On Aug 28, 7:27 pm, comopasta Gr <li...@ruby-forum.com> wrote:
> David K. wrote in post #1018917:
>
> > On Sun, Aug 28, 2011 at 8:09 AM, Frederick Cheung <
> > frederick.che...@gmail.


> I don't know for sure how Rails knows the local time (browser?) because
> I couldn't find anything in the request object that would indicate that.
> When request something locally I can see: ...for 127.0.0.1 at 2011-08-28
> 20:53:49 +0300 for example.
>
> In any case I have the part to get the timezone offset from the browser
> and I could use that info in a before filter. But the way I was reading
> the docs I thought I could save that before filter.
>
Local would mean whatever the local timezone is set to on the server
(and influenced by things like the TZ environment variable. I seem to
remember that setting is best left as :utc, using config.time_zone
(which controls the default value of Time.zone) for making your times
display in whatever timezone you need.


Fred


> A bit mixed up...
>
> --
> Posted viahttp://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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate