Created
November 5, 2010 23:48
-
-
Save house9/665048 to your computer and use it in GitHub Desktop.
cool date functions in ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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