Java Tutorials
LocalDateTime represents 4 digit year,
now()
method returns system's date.of
method returns specific date of your choice. Both are static methods.LocalDateTime date = LocalDateTime.now(); LocalDateTime date =LocalDateTime.of(2020); System.out.println(date); 2020-11-11
ADS