Colin Law wrote in post #973150: > On 7 January 2011 17:30, Robert Walker <[email protected]> wrote: >>> = 1) AND ("flights"."departure_datetime" >= '2011-01-07 17:21:56.932566' >>> AND "flights"."departure_datetime" < '2011-01-08 17:21:56.932568') >> >> Oops, The above statements are actually correct but the resulting SQL >> show here was incorrect. Should have been: >> >> SELECT "flights".* FROM "flights" WHERE ("flights"."arrival_airport_id" >> = 1) AND ("flights"."departure_datetime" >= '2011-01-07' AND >> "flights"."departure_datetime" < '2011-01-08') > > I think the above would only be correct if the OP is operating in UTC, > generally he should make @date the UTC time for the start of the local > day as the datetimes in the db will be in utc.
Good catch, thanks Colin. -- 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 [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.

