Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.6-rc-2
-
None
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() }
Attachments
Attachments
Issue Links
- is duplicated by
-
GROOVY-6083 TimeCategory days ago toString inconsistent
- Closed