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

Incorrect DateFormatSymbols when locale is Locale.US

XMLWordPrintable

    • generic
    • generic

      Even if Local.US is passed to the constructor of "DateFormatSymbols" as a value
      of the argument, SimpleDateFormat doesn't generate in English correctly.

      import java.text.*;
      import java.util.*;

      public class seln{
          public static void main(String[] args){
              Locale locale = Locale.JAPAN;
              DateFormatSymbols formatData;
              SimpleDateFormat dateFormat;
              formatData = new DateFormatSymbols(locale);
              dateFormat = new SimpleDateFormat("yyyy.MMMM.dd GGG hh:mm aaa", formatDa
      ta);
              System.out.println("Default is "+Locale.getDefault().getDisplayName());
              System.out.println(dateFormat.format(new Date()));
          }
      }

            apalanissunw Anand Palaniswamy (Inactive)
            sishidasunw Shoji Ishida (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: