Skip to content

Instantly share code, notes, and snippets.

@debborafernandess
Last active August 29, 2015 14:27
Show Gist options
  • Save debborafernandess/7f91812f68375391afe9 to your computer and use it in GitHub Desktop.
Save debborafernandess/7f91812f68375391afe9 to your computer and use it in GitHub Desktop.
>> 30.days.from_now
=> Sun, 13 Sep 2015 17:39:30 BRT -03:00
>> 30.days.from_now.class
=> ActiveSupport::TimeWithZone
>> Date.today + 30
=> Sun, 13 Sep 2015
>> (Date.today + 30).class
=> Date
Beginning of Month
>> (Date.today + 30).beginning_of_month
=> Tue, 01 Sep 2015
>> 30.days.from_now.beginning_of_month
=> Tue, 01 Sep 2015 00:00:00 BRT -03:00
End of Month
>> (Date.today + 30).end_of_month
=> Wed, 30 Sep 2015
>> 30.days.from_now.end_of_month
=> Wed, 30 Sep 2015 23:59:59 BRT -03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment