You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Time.current.beginning_of_day
=> Tue, 12 Jan 2016 00:00:00 CET +01:00
Time.current.beginning_of_hour
=> Tue, 12 Jan 2016 18:00:00 CET +01:00
Time.current.beginning_of_minute
=> Tue, 12 Jan 2016 18:12:00 CET +01:00
Time.current.end_of_day
=> Tue, 12 Jan 2016 23:59:59 CET +01:00
Time.current.end_of_hour
=> Tue, 12 Jan 2016 18:59:59 CET +01:00
Time.current.end_of_minute
=> Tue, 12 Jan 2016 18:15:59 CET +01:00
Use case
date = DateTime.current
Data.where(created_at: date.beginning_of_day..date.end_of_day)