List of usage examples for java.time MonthDay from
public static MonthDay from(TemporalAccessor temporal)
From source file:Main.java
public static void main(String[] args) { MonthDay m = MonthDay.from(LocalDate.now()); System.out.println(m); }
From source file:Main.java
public static void main(String[] argv) { LocalDate dateOfBirth = LocalDate.now(); MonthDay birthday = MonthDay.of(dateOfBirth.getMonth(), dateOfBirth.getDayOfMonth()); MonthDay currentMonthDay = MonthDay.from(LocalDate.now()); if (currentMonthDay.equals(birthday)) { System.out.println("Yes!!"); } else {/*from w w w . j a v a 2 s . c o m*/ System.out.println("Sorry, today is not your birthday"); } }