Answers for "java calendar get number of days in month"

2

java number of days between dates

LocalDate start = LocalDate.parse("2020-11-03");
LocalDate end = LocalDate.parse("2020-12-15");

long diff = DAYS.between(start, end);
Posted by: Guest on February-12-2021
0

java get number of months between two dates

LocalDate currentDay = LocalDate.of(1955, Month.MAY, 19);
		LocalDate desiredDay = LocalDate.now();
		Period age = Period.between(currentDay, desiredDay);
		int years = age.getYears();
		int months = age.getMonths();

		int numberOfMonthsBetweenDates =  months+years*12;
Posted by: Guest on October-01-2020

Code answers related to "java calendar get number of days in month"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language