Thank you for the fast answer, but is not what I was looking for.
I have found out something that is closer to what I'm searching for, but this code gives the answer in months and days:
Calculate Age / Duration Between Two Dates using JavaScript[
^]
I need a code that will calculate the
difference between two dates in months.
For example the difference in months between 20.JUNE.13 - 15.MAY.14, is equal to 0,36666 (19 days from June)+ JUL+ AUG+ SEP+ OCT+ NOV+ DEC+ JAN+ FEB+ MAR+ APR+ 0.48387 (15 days from MAY) =
10.85053 months.