FileDocCategorySizeDatePackage
DateFormatSymbolsDemo.javaAPI DocExample1935Tue Dec 12 18:57:36 GMT 2000None

DateFormatSymbolsDemo

public class DateFormatSymbolsDemo extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidchangeWeekDays()


      Date today;
      String result;
      SimpleDateFormat formatter;
      DateFormatSymbols symbols;
      String[] defaultDays;
      String[] modifiedDays;

      symbols = new DateFormatSymbols(new Locale("en","US"));
      defaultDays = symbols.getShortWeekdays();

      for (int i = 0; i < defaultDays.length; i++) {
         System.out.print(defaultDays[i] + "  ");
      }
      System.out.println();

      String[] capitalDays = {
         "", "SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
      symbols.setShortWeekdays(capitalDays);

      modifiedDays = symbols.getShortWeekdays();
      for (int i = 0; i < modifiedDays.length; i++) {
         System.out.print(modifiedDays[i] + "  ");
      }

      System.out.println();
      System.out.println();

      formatter = new SimpleDateFormat("E", symbols);
      today = new Date();
      result = formatter.format(today);
      System.out.println(result);
   
public static voidmain(java.lang.String[] args)

      changeWeekDays();