List of usage examples for java.text SimpleDateFormat SimpleDateFormat
public SimpleDateFormat()
SimpleDateFormat
using the default pattern and date format symbols for the default java.util.Locale.Category#FORMAT FORMAT locale. From source file:Main.java
public static void main(String[] argv) throws Exception { SimpleDateFormat formatter = new SimpleDateFormat(); formatter.applyPattern("MMM"); System.out.println(formatter.clone().equals(new SimpleDateFormat())); }
From source file:Main.java
public static void main(String[] argv) throws Exception { SimpleDateFormat formatter = new SimpleDateFormat(); formatter.applyPattern("MMM"); System.out.println(formatter.equals(new SimpleDateFormat())); }
From source file:Main.java
public static void main(String[] args) throws Exception { SimpleDateFormat sd = new SimpleDateFormat(); String dateString = "2015-01-02 14:59:27.953"; sd.applyPattern("yyyy-MM-dd HH:mm:ss.SSS"); Date date = sd.parse(dateString); sd.applyPattern("MM/dd/yyyy HH:mm a"); System.out.println(sd.format(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); }
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.toLocalizedPattern()); System.out.println("date = " + 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.hashCode()); System.out.println("date = " + 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);/*from ww w. j a v a 2s.c o 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[] argv) throws Exception { SimpleDateFormat formatter = new SimpleDateFormat(); formatter.applyLocalizedPattern("MMM"); String s = formatter.format(new Date()); System.out.println(s);//from w ww . jav a 2s. co m }
From source file:Main.java
public static void main(String[] argv) throws Exception { SimpleDateFormat formatter = new SimpleDateFormat(); formatter.applyPattern("MMM"); String s = formatter.format(new Date()); System.out.println(s);// www . j ava2 s .com }
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("date = " + date); }