groovy
  1. groovy
  2. GROOVY-4789

Add method on Date to parse strings created with date.toString()

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Minor 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 :
      1

      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

        No work has yet been logged on this issue.

          People

          • Assignee:
            CÚdric Champeau
            Reporter:
            Dean Moses
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: