Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
2.0.0
-
None
-
None
-
Grails 2.2.1 and http://groovyconsole.appspot.com/
Description
I ran accross this issue when working with MongoDB on Grails.
For what reason is the output of the following lines different from each other?
use(groovy.time.TimeCategory) {
println 3.days.ago
println 3.days.ago + 0.seconds
}
I'd expect to get the same long string "Tue Apr 02 00:00:00 UTC 2013" but the first one yields "2013-04-02"
This leads to inconsistencies (e. g. for the first one, MongoDB doesn't understand it's a date)
My suspicion is that this is somehow related to a toString implementation based on cdate rather than fasttime. I might be wrong.
You can confirm this on http://groovyconsole.appspot.com/
Attachments
Issue Links
- duplicates
-
GROOVY-3332 The groovy.time.*Duration classes make use of java.sql.Date
- Closed