method
prev_day
rails latest stable - Class:
DateAndTime::Calculations
Method deprecated or moved
This method is deprecated or moved on the latest stable version. The last existing version (v5.2.3) is shown here.
prev_day(days = 1)public
Returns a new date/time the specified number of days ago.
# File activesupport/lib/active_support/core_ext/date_and_time/calculations.rb, line 24
def prev_day(days = 1)
advance(days: -days)
end Related methods
- Instance methods
- all_day
- all_month
- all_quarter
- all_week
- all_year
- at_beginning_of_month
- at_beginning_of_quarter
- at_beginning_of_week
- at_beginning_of_year
- at_end_of_month
- at_end_of_quarter
- at_end_of_week
- at_end_of_year
- beginning_of_month
- beginning_of_quarter
- beginning_of_week
- beginning_of_year
- days_ago
- days_since
- days_to_week_start
- end_of_month
- end_of_quarter
- end_of_week
- end_of_year
- future?
- last_month
- last_quarter
- last_week
- last_weekday
- last_year
- monday
- months_ago
- months_since
- next_day
- next_month
- next_occurring
- next_quarter
- next_week
- next_weekday
- next_year
- on_weekday?
- on_weekend?
- past?
- prev_day
- prev_month
- prev_occurring
- prev_quarter
- prev_week
- prev_weekday
- prev_year
- sunday
- today?
- tomorrow
- weeks_ago
- weeks_since
- years_ago
- years_since
- yesterday
- Private methods
-
copy_time_to -
days_span -
first_hour -
last_hour