import datetime def get_months_between(start_date: datetime.datetime, end_date: datetime.datetime) -> int: """ Calculate number of months between two dates. """ months = (end_date.year - start_date.year) * 12 + (end_date.month - start_date.month) # Add 1 to include both start and end months return months + 1