List of usage examples for java.util Calendar getInstance
public static Calendar getInstance()
From source file:Main.java
public static void main(String[] args) { Calendar now = Calendar.getInstance(); System.out.println(now.getTime()); System.out.println(now.get(Calendar.DAY_OF_MONTH)); }
From source file:Main.java
public static void main(String[] args) { Calendar now = Calendar.getInstance(); System.out.println(now.getTime()); System.out.println(now.get(Calendar.ERA)); }
From source file:Main.java
public static void main(String[] args) { Calendar now = Calendar.getInstance(); System.out.println(now.getTime()); System.out.println(now.get(Calendar.DAY_OF_YEAR)); }
From source file:Main.java
public static void main(String[] args) { Calendar now = Calendar.getInstance(); System.out.println(now.getTime()); System.out.println(now.get(Calendar.DAY_OF_WEEK_IN_MONTH)); }
From source file:Main.java
public static void main(String[] args) { Calendar now = Calendar.getInstance(); String[] strDays = new String[] { "Sunday", "Monday", "Tuesday", "Wednesday", "Thusday", "Friday", "Saturday" }; System.out.println("Current day is : " + strDays[now.get(Calendar.DAY_OF_WEEK) - 1]); }
From source file:Main.java
public static void main(String[] args) { Calendar now = Calendar.getInstance(); System.out.println("Current milliseconds since Jan 1, 1970 are :" + now.getTimeInMillis()); }
From source file:Main.java
public static void main(String[] args) { Calendar now = Calendar.getInstance(); System.out.println(now.getTime()); System.out.println(now.get(Calendar.WEEK_OF_YEAR)); }
From source file:Main.java
public static void main(String[] args) { Calendar now = Calendar.getInstance(); System.out.println(now.getTime()); System.out.println(now.get(Calendar.HOUR_OF_DAY)); }
From source file:Main.java
public static void main(String[] args) { Calendar now = Calendar.getInstance(); System.out.println(now.getTime()); System.out.println(now.get(Calendar.WEEK_OF_MONTH)); }
From source file:Main.java
public static void main(String[] args) { Calendar now = Calendar.getInstance(); System.out.print(now.getWeekYear()); }