Answers for "java get first day of week"

1

java first day of week

LocalDate now = LocalDate.now();

LocalDate firstDayOfWeek = now.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY));
Posted by: Guest on February-12-2021
0

java get first day of the week

private static Date firstDayOfWeek(Date date) {
   Calendar calendar = Calendar.getInstance();
   calendar.setTime(date);
   calendar.set(Calendar.DAY_OF_WEEK, 1);
   return calendar.getTime();
}
Posted by: Guest on January-02-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language