Created
August 19, 2014 07:59
-
-
Save porras/5d4010a254635cedbb6e to your computer and use it in GitHub Desktop.
Fun with dates
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
>> require 'date' | |
=> true | |
>> Date.today.next_month | |
=> #<Date: 2014-09-19 (4913839/2,0,2299161)> | |
>> Date.today.next_month - 1 | |
=> #<Date: 2014-09-18 (4913837/2,0,2299161)> | |
>> Date.today.next_month -1 | |
=> #<Date: 2014-07-19 (4913715/2,0,2299161)> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
funny thing,
Date.today.next_month-1
also does the job correctly.