Calculates the days between two dates based on the 360-day year.
- Implementation of Excel's (or Number's)
DAYS360
/TAGE360
formula in python. - Both EU and US methods of calculation are supported, with optional Excel bug compatibility.
pip install days360
from datetime import date
from days360 import days360
date_a = date(2022, 10, 2)
date_b = date(2023, 11, 30)
# supported methods: "US" (default), "US_NASD", "EU"
days = days360(date_a, date_b, method="US")
print(days) # prints 418
- ISDA, PSA and SIA methods
- Implementations are based on https://en.wikipedia.org/wiki/360-day_calendar.
- This library started as a port of this ruby gem: https://github.com/tamaloa/days360/tree/master