Using Locale for Java Date
Class LocalDate: LocalDate is an immutable date-time object that represents a date, often viewed as year-month-day. The default format for date is yyyy-MM-dd. E.g. To get current date: LocalDate date = LocalDate.now(); Let’s start with some practical uses of LocaleDate. 1. To get the start(Monday) and end(Sunday) date of current week : LocalDate today = LocalDate.now(); LocalDate monday = today; //Go backword by 1 day, till we find the Monday //java.time.DayOfWeek is a java time API while(monday.getDayOfWeek() != DayOfWeek.MONDAY) { monday = monday.minusDays(1); } //Similarly, go forward to find Sunday using monday as current day LocalDate...