Java – Check if the date is older than 30 days or 6 months
This article shows Java 8 and legacy date-time APIs example to check if a date is 30 days or 6 months older than the current date. We can use few…
Favourite tutorials for developers
This article shows Java 8 and legacy date-time APIs example to check if a date is 30 days or 6 months older than the current date. We can use few…
In Java 8, we can use Period, Duration or ChronoUnit to calculate the difference between two LocalDate or LocaldateTime: 1 - Period to calculate the difference between two LocalDate, 2…
This article shows few examples to compare two dates in Java. Updated with Java 8 examples. For the legacy java.util.Date, we can use compareTo, before(), after() and equals() to compare…
Few examples to show you how to use Java 8 Duration, Period and ChronoUnit objects to find out the difference between dates. Duration – Measures time in seconds and nanoseconds.…