The Java Time API (java.time) provides a comprehensive model for date and time.
Source Code
import java.time.LocalDate;
public class DateExample {
public static void main(String[] args) {
LocalDate today = LocalDate.now();
LocalDate birthday = LocalDate.of(1990, 1, 1);
System.out.println("Today: " + today);
System.out.println("Birthday: " + birthday);
}
}