List of usage examples for java.util Date Date
public Date()
From source file:TimeFormatDemo.java
public static void main(String args[]) { Date date = new Date(); DateFormat df;/* w ww. j a v a 2s. com*/ df = DateFormat.getTimeInstance(DateFormat.SHORT, Locale.JAPAN); System.out.println("Japan: " + df.format(date)); df = DateFormat.getTimeInstance(DateFormat.LONG, Locale.UK); System.out.println("United Kingdom: " + df.format(date)); df = DateFormat.getTimeInstance(DateFormat.FULL, Locale.CANADA); System.out.println("Canada: " + df.format(date)); }
From source file:MainClass.java
public static void main(String args[]) throws Exception { Date date = new Date(); System.out.printf("The DATE is %tC\n", date); }
From source file:Main.java
public static void main(String[] argv) throws Exception { Date date = new Date(); Format formatter = new SimpleDateFormat("MM/dd/yy"); String s = formatter.format(date); System.out.println(s);/*from ww w .jav a 2 s . c om*/ }
From source file:Main.java
public static void main(String[] args) { System.out.println(asLocalDateInUTC(new Date())); }
From source file:MainClass.java
public static void main(String args[]) { Formatter fmt = new Formatter(); fmt.format("%t", new Date()); System.out.println(fmt);/*ww w. j a v a2 s . c o m*/ }
From source file:MainClass.java
public static void main(String args[]) throws Exception { Date date = new Date(); System.out.printf("The DATE is %tD\n", date); }
From source file:Main.java
public static void main(String[] args) { Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); }
From source file:MainClass.java
public static void main(String args[]) throws Exception { Date date = new Date(); System.out.printf("The DATE is %tz\n", date); }
From source file:MainClass.java
public static void main(String args[]) throws Exception { Date date = new Date(); System.out.printf("The DATE is %tr\n", date); }
From source file:PrintfExamples.java
public static void main(String[] args) { System.out.printf(Locale.ITALIAN, "The date is %tc\n", new Date()); System.out.printf(Locale.CHINA, "The date is %tc\n", new Date()); System.out.printf(Locale.FRENCH, "The date is %tc\n", new Date()); System.out.printf(Locale.GERMAN, "The date is %tc\n", new Date()); }