import dateutil.relativedelta
from datetime import datetime


def format_time_difference(t1: datetime, t2: datetime):
    """
    Displays the time difference from t1 to t2 in a human - readable form.
    Inspired by https://stackoverflow.com/a/11157649/243519
    """

    difference = dateutil.relativedelta.relativedelta(t2, t1)
    return ', '.join([str(getattr(difference, attr)) + ' ' + attr for attr in
                      ['years', 'months', 'days', 'hours', 'minutes', 'seconds']
                      if getattr(difference, attr) or attr == 'seconds'])