javadatejava-8jsr310

Create LocalDate Object from Integers


If I already have a date's month, day, and year as integers, what's the best way to use them to create a LocalDate object? I found this post String to LocalDate , but it starts with a String representation of the date.


Solution

  • Use LocalDate#of(int, int, int) method that takes year, month and dayOfMonth.