This content has been marked as final.
Show 6 replies

1. Re: How do I calculate # of months between 2 dates in Acrobat DC form?
try67 Nov 3, 2017 9:12 AM (in response to scotts74312160)Just divide the result by 12...
On Fri, Nov 3, 2017 at 4:47 PM, scotts74312160 <forums_noreply@adobe.com>

2. Re: How do I calculate # of months between 2 dates in Acrobat DC form?
try67 Nov 3, 2017 9:13 AM (in response to scotts74312160)Sorry, I meant by 30...

3. Re: How do I calculate # of months between 2 dates in Acrobat DC form?
gkaiseril Nov 3, 2017 10:28 AM (in response to scotts74312160)One can use the getFullYear(), getMoth() and getDate() methods to get the number of years, months and the date within the month respectively. With these values one can easily calculate the number or fractional months to use in the unused term calculation even when the dates cross a year boundary and the all months are assumed to have 30 days.

4. Re: How do I calculate # of months between 2 dates in Acrobat DC form?
scotts74312160 Nov 3, 2017 12:00 PM (in response to scotts74312160)I'm ok with assuming a 30 day month for my purposes. The calculation is general for what we need it for. How would I divide this result by 30 using my existing script?

5. Re: How do I calculate # of months between 2 dates in Acrobat DC form?
try67 Nov 3, 2017 1:34 PM (in response to scotts74312160)1 person found this helpfulChange:
event.value = Math.floor(diff / 864e5);
To:
event.value = Math.floor(diff / 864e5) / 30;

6. Re: How do I calculate # of months between 2 dates in Acrobat DC form?
scotts74312160 Nov 6, 2017 7:03 AM (in response to try67)Thank You!