Skip to content

Instantly share code, notes, and snippets.

@house9
Created November 5, 2010 23:48
Show Gist options
  • Save house9/665048 to your computer and use it in GitHub Desktop.
Save house9/665048 to your computer and use it in GitHub Desktop.
cool date functions in ruby
last_month = Date.today.last_month # => Tue, 05 Oct 2010
last_month.beginning_of_month # => Fri, 01 Oct 2010
last_month.end_of_month # => Sun, 31 Oct 2010
last_month.beginning_of_quarter # => Fri, 01 Oct 2010
last_month.end_of_quarter # => Fri, 31 Dec 2010
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment