Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-1166

FastDateFormat does not honour 'ZZ' pattern

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 3.4
    • None
    • lang.time.*
    • None

    Description

      A date format of "yyyy-MM-dd'T'HH:mm:ss.SSS ZZ" returns "2015-08-13T11:37:13.203 Z" for UTC timezone in version 3.4.

      Same format with version 3.3.2 returns "2015-08-13T11:39:28.452 +00:00"

      The code which i am using to test this is as follows:

      import org.apache.commons.lang3.time.FastDateFormat;
      
      import java.util.Date;
      import java.util.TimeZone;
      
      public class FastDateFormatTest {
          private static final String         DATE_FORMAT    = "yyyy-MM-dd'T'HH:mm:ss.SSS ZZ";
          private static       FastDateFormat fastDateFormat = FastDateFormat.getInstance(DATE_FORMAT, TimeZone.getTimeZone("UTC"));
      
          public static void main(String[] args) {
              System.out.println("fastDateFormat = " + fastDateFormat.format(new Date()));
          }
      }
      

      Attachments

        Activity

          People

            chonton Charles Honton
            abg1979 Abhishek Gupta
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: