List of usage examples for java.text DateFormatSymbols setWeekdays
public void setWeekdays(String[] newWeekdays)
From source file:Main.java
public static void main(String[] args) { String[] newMonths = { "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC" }; String[] newShortMonths = { "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec" }; String[] newWeekdays = { "", "Monday", "Tuesday", "Webnesday", "Thursday", "Friday", "Saturaday", "Sunday" }; String[] shortWeekdays = { "", "monday", "tuesday", "webnesday", "thursday", "friday", "saturaday", "sunday" }; DateFormatSymbols symbols = new DateFormatSymbols(); symbols.setMonths(newMonths);// w ww.j a v a 2 s . c o m symbols.setShortMonths(newShortMonths); symbols.setWeekdays(newWeekdays); symbols.setShortWeekdays(shortWeekdays); DateFormat format = new SimpleDateFormat("dd MMMM yyyy", symbols); System.out.println(format.format(new Date())); format = new SimpleDateFormat("dd MMM yyyy", symbols); System.out.println(format.format(new Date())); format = new SimpleDateFormat("EEEE, dd MMM yyyy", symbols); System.out.println(format.format(new Date())); format = new SimpleDateFormat("E, dd MMM yyyy", symbols); System.out.println(format.format(new Date())); }