【发布时间】:2011-09-03 11:55:13
【问题描述】:
应用程序.rb
config.time_zone = 'Athens'
entry_controller
from = Time.zone.now.beginning_of_day-5.day
to = Time.zone.now.end_of_day
@entries = Entry.where(:published_at => from..to).group("date(published_at)").select("date(published_at) as date, count(*) as entries_count")
由于时区原因,它不会返回正确的 entries_count。任何人都知道如何处理组与时区?任何帮助表示赞赏。
我在here 中找到了一些东西,但没有用。
【问题讨论】:
标签: mysql ruby-on-rails