method
beginning_of_month
rails latest stable - Class:
DateAndTime::Calculations
beginning_of_month()public
Returns a new date/time at the start of the month.
today = Date.today # => Thu, 18 Jun 2015 today.beginning_of_month # => Mon, 01 Jun 2015
DateTime objects will have a time set to 0:00.
now = DateTime.current # => Thu, 18 Jun 2015 15:23:13 +0000 now.beginning_of_month # => Mon, 01 Jun 2015 00:00:00 +0000