Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.7.10
-
Fix Version/s: 1.8.4, 2.0-beta-1
-
Component/s: groovy-jdk
-
Labels:None
-
Number of attachments :
Description
People often need to re-parse Dates out of strings created from date.toString().
My particular system's default date.toString() format is "Thu Apr 20 00:27:00 CEST 2006" so I know I can turn a Date into a string and then back into an object using Date.parse('EEE MMM dd HH:mm:ss z yyyy', new Date().toString()).
But breaks when date.toString() changes format, either in a future version of Groovy or when the code moves to another system where date.toString() produces a different format (I'm not clear if this can happen or not).
Activity
Dirk Weber
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Attachment | groovy_4789.patch [ 57423 ] |
Cedric Champeau
made changes -
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Assignee | Cedric Champeau [ melix ] | |
| Fix Version/s | 1.9-beta-5 [ 17925 ] | |
| Fix Version/s | 1.8.4 [ 17852 ] | |
| Resolution | Fixed [ 1 ] |
Paul King
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |
Looking at the source code for toString() on java.util.Date it looks like the following format is always used: "EEE MMM dd HH:mm:ss zzz yyyy". So, perhaps there is nothing to do here.