List of usage examples for java.text SimpleDateFormat SimpleDateFormat
public SimpleDateFormat(String pattern)
SimpleDateFormat
using the given pattern and the default date format symbols for the default java.util.Locale.Category#FORMAT FORMAT locale. From source file:Main.java
public static void main(String[] args) { Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat("MMMM"); System.out.println("Current Month in MMMM format : " + sdf.format(date)); }
From source file:Main.java
public static void main(String[] args) throws Exception { DateFormat df = new SimpleDateFormat("dd/MM/yyyy"); Date today = df.parse("20/12/2005"); System.out.println("Today = " + df.format(today)); }
From source file:Main.java
public static void main(String[] argv) throws Exception { Format formatter = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss"); Date date = (Date) formatter.parseObject("2002.01.29.08.36.33"); System.out.println(date);/*from w w w.ja va2s . c om*/ }
From source file:Main.java
public static void main(String[] argv) throws Exception { Format formatter = new SimpleDateFormat("Z"); String s = formatter.format(new Date()); System.out.println(s);//w w w .j a v a 2s .c o m }
From source file:Main.java
public static void main(String[] argv) throws Exception { Format formatter = new SimpleDateFormat("yy"); String s = formatter.format(new Date()); System.out.println(s);/*from ww w .j a v a 2s . c om*/ }
From source file:Main.java
public static void main(String[] argv) throws Exception { Format formatter = new SimpleDateFormat("HH.mm.ss"); String s = formatter.format(new Date()); System.out.println(s);/*ww w. jav a2 s. co m*/ }
From source file:Main.java
public static void main(String[] argv) throws Exception { Format formatter = new SimpleDateFormat("s"); String s = formatter.format(new Date()); System.out.println(s);/* ww w.j a va 2 s . c o m*/ }
From source file:Main.java
public static void main(String[] argv) throws Exception { Format formatter = new SimpleDateFormat("dd-MMM-yy"); Date date = (Date) formatter.parseObject("29-Jan-02"); System.out.println(date);//from w w w .ja v a2s . c o m }
From source file:Main.java
public static void main(String[] argv) throws Exception { Format formatter = new SimpleDateFormat("a"); String s = formatter.format(new Date()); System.out.println(s);//from w w w .j a v a 2 s. co m }
From source file:Main.java
public static void main(String[] argv) throws Exception { Format formatter = new SimpleDateFormat("MM"); String s = formatter.format(new Date()); System.out.println(s);// ww w . j a va 2 s . co m }