Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.6-rc-2
-
Fix Version/s: 2.2.0-beta-1
-
Component/s: groovy-jdk
-
Labels:None
-
Number of attachments :
Description
The groovy.time.*Duration classes make use of java.sql.Date, but there seems to be no justification for doing so.
java.sql.Date is basically the same as java.util.Date except for the toString() formatting. So the second assert fails while the first assert succeeds:
use (org.codehaus.groovy.runtime.TimeCategory) {
Date dt1 = 0.days.from.now
Date dt2 = new Date(0.days.from.now.time)
assert dt1 == dt2
assert dt1.toString() == dt2.toString()
}
Issue Links
- is duplicated by
-
GROOVY-6083
TimeCategory days ago toString inconsistent
-
I suspect that all references to groovy.sql.Date should be replaced with groovy.util.Date