Java LocalDate Calculate withinAYearFromNow(LocalDate date)

Here you can find the source of withinAYearFromNow(LocalDate date)

Description

within A Year From Now

License

Open Source License

Declaration

static boolean withinAYearFromNow(LocalDate date) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.time.*;

public class Main {
    static boolean withinAYearFromNow(LocalDate date) {
        LocalDate withinAYear = LocalDate.of(LocalDate.now().getYear() + 1, LocalDate.now().getMonth(),
                LocalDate.now().getDayOfMonth());
        return (date.isBefore(withinAYear) && date.isAfter(LocalDate.now())) || date.isEqual(LocalDate.now());
    }//w  w  w  .  ja va2 s  . c  om
}

Related

  1. stringDateToLocalDate(String day, String month, String year)
  2. stringToLocalDate(String birthDate)
  3. subscriptionDeletionRequired(LocalDate vehicleMotExpiryDate, LocalDate requestDate)
  4. toMilliseconds(LocalDate localDate)
  5. toPgDays(LocalDate date)
  6. withTime(LocalDate day, int hours, int minutes)
  7. yyyyMMddToLocalDate(String dateStr)