-2

I have two dates date1 and date2, i need to get number of months between those two dates, can any one help me to do.

Sionnach733
  • 4,686
  • 4
  • 36
  • 51
XYZ
  • 27
  • 6

1 Answers1

2
int result = Months.monthsBetween(date1, date2).getValue();
JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255