def add_years(date, years):
    """Add `years` number of years to date."""
    try:
        return date.replace(year=date.year + years)
    except ValueError:
        # Handle 29th of February as 28th in non-leap years:
        return date.replace(year=date.year + years, day=date.day - 1)