I'm trying to calculate the number of days between two specific pairs of dates but the assert is failing on the second test, which is only a week further apart from the first test.
The code is below.
Is there a bug in my code? Or is this a weird java/groovy bug?
use(groovy.time.TimeCategory) {
def duration = Date.parse("yyyy-MM-dd", "2013-03-10") - Date.parse("yyyy-MM-dd", "2012-12-30")
assert duration.days == 70
def duration2 = Date.parse("yyyy-MM-dd", "2013-03-17") - Date.parse("yyyy-MM-dd", "2012-12-30")
assert duration2.days == 77
}