Java tutorial
import static java.time.temporal.ChronoUnit.DAYS; import java.time.LocalDate; public class Main { public static void main(String[] argv) { LocalDate today = LocalDate.now(); LocalDate tomorrow = today.plusDays(1); LocalDate yesterday = today.minus(1, DAYS); if (tomorrow.isAfter(today)) { System.out.println("Tomorrow comes after today"); } if (yesterday.isBefore(today)) { System.out.println("Yesterday is day before today"); } } }