Calculate the years and months from two given dates

1
I want to calcuate the years and months in decimal from two dates given, for example  i have 02-31-2019 earlier date and current date 02-07-2022 , how i calculate the difference? i want the answer  2.6 means 2 years and 6 months.  how i calculate this?
asked
1 answers
3

Hi Neenu,

You can use the Java action “MonthsBetween” from the community commons (MarketPlace Module ) and then divide the outcome by 12 and floor it for the number of years and use the function “mod” 12 for the remaining months.

answered