List of usage examples for java.text DateFormatSymbols setEras
public void setEras(String[] newEras)
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); sdf.setDateFormatSymbols(dfs);// w w w. j a va 2 s . co m 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); sdf.setDateFormatSymbols(dfs);//from w ww . j a v a 2 s .co m sdf.applyPattern("MMMM d yyyy G"); System.out.println(sdf.format(new Date())); }