R
R
Romario212018-05-25 14:13:46
Java
Romario21, 2018-05-25 14:13:46

How to get the start and end date of the previous week?

How can I find the start and end date of the previous week?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2018-05-25
@Romario21

LocalDate now = LocalDate.now();
LocalDate lastWeekStart = now.minusWeeks(1).with(DayOfWeek.MONDAY);
LocalDate lastWeekEnd = lastWeekStart.plusDays(6);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question