D days= D2 - D1 + 30 (M2 - M1) + 360 (Y2 - Y1)
Where M1/D1/Y1 is the first date and M2/D2/Y2 is the second date.
If D1 falls on the 31st, change it to 30. If D2 falls on the 31st, change it to 30 only if D1 falls on either the 30th or the 31st.
The denominator is 360.
There are three different ways to apply the 30/360 rule: 30/360, 30E/360, and 30e+/360.
D days= D2 - D1 + 30 (M2 - M1) + 360 (Y2 - Y1)
Where M1/D1/Y1 is the first date and M2/D2/Y2 is the second date.
If D1 falls on the 31st, change it to 30. If D2 falls on the 31st, change it to 30.
D days= D2 - D1 + 30 (M2 - M1) + 360 (Y2 - Y1)
Where M1/D1/Y1 is the first date and M2/D2/Y2 is the second date.
If D1 falls on the 31st, change it to 30. If D2 falls on the 31st, change it to 1 and increase M2 by 1.