i have a date and how to get all the dates fall on the week that the given date belongs in java?
example: if i give today\'s date then i should get all date
Calendar calendar = Calendar.getInstance(); int offset = calendar.get(Calendar.DAY_OF_WEEK) - 1; calendar.add(Calendar.DATE, -offset); for(int i = 0; i < 7; i++){ System.out.println(calendar.getTime()); calendar.add(Calendar.DATE, 1); }