# Number of month between two dates

Hi
I want to know if there is a way to get the number of month between two dates. Bubble can only give the result as days, hours, minutes and second or if there is a plugin (free or not) that can help me do that.
I could have divide the number by 30 but it is not always exact and I need precision in this case

1 Like

Thereâ€™s an easy way, but if one date is at September 29 and the other is October 1st, this will result in â€ś1â€ť, is that what you want?
You can the the â€śextractâ€ť thing, so letâ€™s say you have two dates, DATE1, and DATE2, being DATE2>DATE1, you can make

DATE2:extract(year) - DATE1:extract(year)*12 +DATE2:extract(month) - DATE1:extract(month)

4 Likes

Many thanks !!!
It seems to be the right solution !!!

I tried this formula and didnâ€™t seem to work. the 2 dates are just over a year apart and its giving me a number of 24266

hi, check out if there isnâ€™t any empty dateâ€¦ if you try to calculate it with an empty date, it will result in absurd numbers