application.rb
config.time_zone = 'Athens'
I want to list entries which are published between any date ranges.The query below starts listing entries which are published_at after 03:00 not 00:00 Any help will be appreciated.
@from_date = (Time.zone.now-1.day).to_date.to_datetime #iam trying to set time to 00:00
@to_date = (Time.zone.now+1.day).to_date.to_datetime
Entry.where(:spam => false, :published_at => @report_from_date..@report_to_date)
You might look at using
beginning_of_dayandend_of_day. For example, to show everything within the current day: