Java examples for java.util:Week
get Current Weekends
//package com.java2s; import java.util.Calendar; public class Main { public static void main(String[] argv) throws Exception { System.out.println(getCurrentWeekends()); }/*from w w w. ja v a 2 s .c o m*/ public static Calendar getCurrentWeekends() { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.DAY_OF_WEEK, calendar.getFirstDayOfWeek()); calendar.add(Calendar.DAY_OF_MONTH, -2); return calendar; } }