class Date

def ago(seconds)

and then subtracts the specified number of seconds.
Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00)
def ago(seconds)
  in_time_zone.since(-seconds)
end