List of usage examples for java.util Calendar TUESDAY
int TUESDAY
To view the source code for java.util Calendar TUESDAY.
Click Source Link
From source file:MainClass.java
public static void main(String[] a) { GregorianCalendar calendar = new GregorianCalendar(); calendar.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY); }
From source file:MainClass.java
public static void main(String[] a) { GregorianCalendar calendar = new GregorianCalendar(); calendar.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY); calendar.add(Calendar.YEAR, -14); System.out.println(calendar.get(Calendar.YEAR)); }
From source file:MainClass.java
public static void main(String[] a) { GregorianCalendar calendar = new GregorianCalendar(); calendar.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY); calendar.add(Calendar.YEAR, 14); // 14 years into the future System.out.println(calendar.get(Calendar.YEAR)); }
From source file:MainClass.java
public static void main(String[] a) { GregorianCalendar calendar = new GregorianCalendar(); calendar.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY); int day = calendar.get(Calendar.DAY_OF_WEEK); System.out.println(day);/* w w w. ja va 2 s .co m*/ }
From source file:Main.java
public static void main(String[] a) { GregorianCalendar calendar = new GregorianCalendar(); calendar.set(Calendar.DAY_OF_WEEK, Calendar.TUESDAY); int day = calendar.get(Calendar.DAY_OF_WEEK); switch (day) { case Calendar.MONDAY: System.out.println(Calendar.MONDAY); break;//from ww w . j a v a 2 s . c o m case Calendar.TUESDAY: System.out.println(Calendar.TUESDAY); break; default: System.out.println("others"); } }
From source file:Main.java
public static void main(String args[]) { SimpleTimeZone stobj = new SimpleTimeZone(820, "GMT"); // checking the initial value System.out.println("Initial value : " + stobj); // setting end rule stobj.setEndRule(Calendar.MAY, 2, Calendar.TUESDAY, 3600000, true); // checking the new value System.out.println("New value : " + stobj); }
From source file:Main.java
public static void main(String args[]) { SimpleTimeZone stobj = new SimpleTimeZone(820, "GMT"); // checking the initial value System.out.println("Initial value : " + stobj); // setting end rule stobj.setEndRule(Calendar.MAY, 2, Calendar.TUESDAY, 3600000); // checking the new value System.out.println("New value : " + stobj); }
From source file:Main.java
public static void main(String[] args) { Calendar now = Calendar.getInstance(); System.out.println(now.getTime()); int dayOfWeek = now.get(Calendar.DAY_OF_WEEK); if (Calendar.SUNDAY == dayOfWeek) { System.out.println("SUNDAY"); }/* w w w . jav a 2s. c o m*/ if (Calendar.MONDAY == dayOfWeek) { System.out.println("MONDAY"); } if (Calendar.TUESDAY == dayOfWeek) { System.out.println("TUESDAY"); } if (Calendar.WEDNESDAY == dayOfWeek) { System.out.println("WEDNESDAY"); } if (Calendar.THURSDAY == dayOfWeek) { System.out.println("THURSDAY"); } if (Calendar.FRIDAY == dayOfWeek) { System.out.println("FRIDAY"); } if (Calendar.SATURDAY == dayOfWeek) { System.out.println("SATURDAY"); } }
From source file:Main.java
public static void main(String args[]) { SimpleTimeZone stobj = new SimpleTimeZone(-28800000, "America/Los_Angeles", Calendar.AUGUST, 1, -Calendar.SUNDAY, 7200000, Calendar.DECEMBER, -1, Calendar.SUNDAY, 7200000, 3600000); // checking the initial value System.out.println("Initial value : " + stobj); // setting end rule stobj.setEndRule(Calendar.MAY, 2, Calendar.TUESDAY, 3600000); // checking the new value System.out.println("New value : " + stobj); }
From source file:MainClass.java
public static void main(String args[]) { Calendar cal = Calendar.getInstance(); Date now = new Date(); cal.setTime(now);/* w w w.j a v a 2 s .com*/ int dayofweek = cal.get(Calendar.DAY_OF_WEEK); if (dayofweek == Calendar.SUNDAY) System.out.println("SUNDAY"); if (dayofweek == Calendar.MONDAY) System.out.println("MONDAY"); if (dayofweek == Calendar.TUESDAY) System.out.println("TUESDAY"); if (dayofweek == Calendar.WEDNESDAY) System.out.println("WEDNESDAY"); if (dayofweek == Calendar.THURSDAY) System.out.println("THURSDAY"); if (dayofweek == Calendar.FRIDAY) System.out.println("FRIDAY"); if (dayofweek == Calendar.SATURDAY) { System.out.println("SATURDAY"); } }