Imagine it’s Jan 19. This will not be hard if you look at this question today.
Date.today
=> Thu, 19 Jan 2012 # as expected
Date.today + 1
=> Fri, 20 Jan 2012 # as expected
Date.today+1
=> Fri, 20 Jan 2012 # as expected
Date.today +1
=> Thu, 19 Jan 2012 # ?!
What am I missing here?
The difference is that:
is an addition of two numerical values and
is a call to the method
todaywith the parametersg(day of calendar reform) with value+1The best way to examine this is to monkey patch the original method with debug output included. See this script as example:
This will print the following console output: