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. 1. Java 8 isBefore() 2. Java 8 ChronoUnit.{UNIT}.between() 3. Java 8 Period.between() 4. Legacy Calendar and Date 5. References 1. Java 8 isBefore() First minus the current date and …