[Rails] Re: ActiveRecord doesn't care about timezone?

2009-09-05 Thread JL Smith
Yeah that sounds pretty nasty. To get around all this, I simply changed my timeline endpoints to start at 30 days ago and end at strictly less than today.midnight. That way I don't include today's numbers which could possibly be wrong because of timezone differences. Thanks Matt. On Sep 4, 12

[Rails] Re: ActiveRecord doesn't care about timezone?

2009-09-04 Thread Matt Jones
I don't think this is going to work - you're grouping by the date in the DB, where they are all UTC. The dates that come back don't have times, so there isn't any way to convert them. (eg, 2009-09-03 02:39:22 UTC -> 2009-09-02 CDT, but 2009-09-03 2009-09-03 12:39:22 UTC -> 2009-09-03 CDT) The onl

[Rails] Re: ActiveRecord doesn't care about timezone?

2009-09-03 Thread JL Smith
Yeah, I tried that in my example that I posted but the results aren't then converted back to the users timezone. So if a Product is sitting in the database with created_at = 2009-09-03 02:39:22 UTC (which is 2009-09-02 21:39:22 CDT), it won't come back converted to CDT. On Sep 3, 11:54 am, Matt

[Rails] Re: ActiveRecord doesn't care about timezone?

2009-09-03 Thread Matt Jones
This looks like an instance of this bug: https://rails.lighthouseapp.com/projects/8994/tickets/2946 The quick way to fix it in this case is to convert the incoming datetime objects to UTC in timeline_created_products. --Matt Jones On Sep 2, 10:23 pm, JL Smith wrote: > I'm having some trouble