[Solved] how to convert LocalDate to a specific date time format [closed]

I am assuming that have got a string, for example 2016-01-25, and that you want a string containing the start of the day in the JVM’s default time zone (it wasn’t clear from the question). I first define a formatter for the format that you want (it’s ISO 8601): private static DateTimeFormatter formatter = DateTimeFormatter.ofPattern(“uuuu-MM-dd’T’HH:mm:ss.SSSxx”); … Read more

[Solved] Date between other Dates java.time [duplicate]

The LocalDate class has isAfter(LocalDate other) isBefore(LocalDate other) isEqual(LocalDate other) methods for comparisons with other dates. Here is an example: LocalDate today = LocalDate.now(); LocalDate tomorrow = LocalDate.now().plusDays(1); LocalDate yesterday = LocalDate.now().minusDays(1); if(today.isAfter(yesterday) && today.isBefore(tomorrow)) System.out.println(“Today is… today!”); solved Date between other Dates java.time [duplicate]