require 'active_support/all' range = (Time.now.beginning_of_day..Time.now.end_of_day) puts range.cover?(Time.now + 2.hours) # true