Java tutorial
import java.time.LocalDate; import java.time.Month; import java.time.Period; public class Main { public static void main(String[] argv) { LocalDate today = LocalDate.now(); LocalDate longestDay = today.with(Month.JUNE).withDayOfMonth(21); int p = Period.between(today, longestDay).getDays(); System.out.println(p); } }