Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4268287

DateFormat.getTimeInstance().format() prints extra text

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3
    • None
    • 1.3.0
    • core-libs
    • generic
    • generic

    Description



      Name: wl91122 Date: 09/02/99


      The output from using DateFormat.getTimeInstance().format() is
      now prepending the short time format before it displays the
      requested formatted time.

      Here's the output from running the test app below:

      % d:/jdk1.3beta/bin/java -cp . timeformat
      DEFAULT: 1:31 PM 1:31:08 PM
      SHORT : 1:31 PM 1:31 PM
      MEDIUM : 1:31 PM 1:31:08 PM
      LONG : 1:31 PM 1:31:08 PM PDT
      FULL : 1:31 PM 1:31:08 PM PDT

      Here's the simple test app you can use to see the bug:

      import java.util.Date;
      import java.text.DateFormat;

      public class timeformat {

          public static void main(String[] args) {
              Date now = new Date();
              System.out.println("DEFAULT: " + DateFormat.getTimeInstance(DateFormat.DEFAULT).format(now));
              System.out.println("SHORT : " + DateFormat.getTimeInstance(DateFormat.SHORT).format(now));
              System.out.println("MEDIUM : " + DateFormat.getTimeInstance(DateFormat.MEDIUM).format(now));
              System.out.println("LONG : " + DateFormat.getTimeInstance(DateFormat.LONG).format(now));
              System.out.println("FULL : " + DateFormat.getTimeInstance(DateFormat.FULL).format(now));
          }
      }
      (Review ID: 94808)
      ======================================================================

      Attachments

        Issue Links

          Activity

            People

              ktakahassunw Koushi Takahashi (Inactive)
              wleesunw William Lee (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: