def format_timedelta(timedelta, strformat):
    """
    Format [datetime.timedelta] to [str].
    Source: https://stackoverflow.com/questions/538666/format-timedelta-to-string
    :param timedelta:
    :param strformat:
    :return:
    """
    hours, remainder = divmod(timedelta.seconds, 3600)
    minutes, seconds = divmod(remainder, 60)
    return strformat.format(hours=hours, minutes=minutes, seconds=seconds)