Colin Law wrote in post #1044565:
On 7 February 2012 17:12, Erwin wrote:
It depends which you want. Times in the db should always be in UTC,
so in the first case it is testing against the start of the day in
local time, which is 23:00 UTC. In the second case it is testing
against the start of the day UTC. So the decision is yours, if you
want your scope to return events from today local time then use the
former, if you want today UTC then use the later. It all depends on
what you mean by 'today'.
And, by "local time" he means "server's local time" not necessarily the
"local time" for the actual user. If you want to support the "user's
local time" then you'll need to know the time zone where the user
actually resides. Typically that's just something you'll have to ask
them when they create their account so you can store their local time
zone along with their account information.

Ughhh! +1 for Stardates.

--
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@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.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 7 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedFeb 7, '12 at 5:13p
activeFeb 8, '12 at 1:17p
posts7
users4
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2022 Grokbase