instance method
beginning_of_year
Ruby on Rails 4.1.16
Since v4.0.13Signature
beginning_of_year()
Return a new date/time at the beginning of the year. Example: 1st January. DateTime objects will have a time set to 0:00.
Source
# File activesupport/lib/active_support/core_ext/date_and_time/calculations.rb, line 106
def beginning_of_year
change(:month => 1).beginning_of_month
end
Defined in activesupport/lib/active_support/core_ext/date_and_time/calculations.rb line 106
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in DateAndTime::Calculations