java get first day of the week

Solutions on MaxInterview for java get first day of the week by the best coders in the world

showing results for - "java get first day of the week"
Leonardo
28 Jul 2018
1private static Date firstDayOfWeek(Date date) {
2   Calendar calendar = Calendar.getInstance();
3   calendar.setTime(date);
4   calendar.set(Calendar.DAY_OF_WEEK, 1);
5   return calendar.getTime();
6}