Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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;
Source by javarevisited.blogspot.com #
 
PREVIOUS NEXT
Tagged: #java #number #months #dates
ADD COMMENT
Topic
Name
4+6 =