List of usage examples for java.text SimpleDateFormat getDateFormatSymbols
public DateFormatSymbols getDateFormatSymbols()
From source file:MainClass.java
public static void main(String args[]) throws Exception { SimpleDateFormat sdf = new SimpleDateFormat(); DateFormatSymbols dfs = sdf.getDateFormatSymbols(); String era[] = { "BCE", "CE" }; dfs.setEras(era);/* w w w . j a va 2 s . com*/ sdf.setDateFormatSymbols(dfs); sdf.applyPattern("MMMM d yyyy G"); System.out.println(sdf.format(new Date())); }
From source file:ChangeEra.java
public static void main(String s[]) { SimpleDateFormat sdf = new SimpleDateFormat(); DateFormatSymbols dfs = sdf.getDateFormatSymbols(); String era[] = { "BCE", "CE" }; dfs.setEras(era);/* ww w . ja va 2s . co m*/ sdf.setDateFormatSymbols(dfs); sdf.applyPattern("MMMM d yyyy G"); System.out.println(sdf.format(new Date())); }
From source file:Main.java
public static void main(String[] args) throws Exception { SimpleDateFormat formatter = new SimpleDateFormat(); String date = formatter.format(new Date()); System.out.println(formatter.getDateFormatSymbols().getLocalPatternChars()); System.out.println("date = " + date); }