Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-4971

DateGroovyMethods should have the method format(java.util.Date, String, TimeZone)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.10
    • 1.8.3, 1.9-beta-4
    • groovy-jdk
    • None
    • Patch

    Description

      Currently there is no simple way to format a Date object within a time zone other that the system time zone.

      A possible implementation would be

      public static String format(Calendar self, String pattern, TimeZone tz) {
      SimpleDateFormat sdf = new SimpleDateFormat(pattern);
      sdf.setTimeZone(tz);
      return sdf.format(self);
      }

      Attachments

        Activity

          People

            paulk Paul King
            veita Alexander Veit
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: