Method: Date#ago
- Defined in:
- activesupport/lib/active_support/core_ext/date/calculations.rb
#ago(seconds) ⇒ Object
Converts Date to a Time (or DateTime if necessary) with the time portion set to the beginning of the day (0:00) and then subtracts the specified number of seconds.
55 56 57 |
# File 'activesupport/lib/active_support/core_ext/date/calculations.rb', line 55 def ago(seconds) in_time_zone.since(-seconds) end |