Created
March 8, 2016 03:06
-
-
Save karuppasamy/0145336a672d65d3595c to your computer and use it in GitHub Desktop.
ruby - number of months between dates
This file contains 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
(end_date.year * 12 + end_date.month) - (start_date.year * 12 + start_date.month) + (end_date.day >= start_date.day ? 1 : 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment