def strfdelta(time_delta, fmt):
    """
        A way to convert time deltas to string formats easily.
    :param time_delta: timedelta object to convert
    :param fmt: string format to output
    :return: String form of timedelta
    """
    d = {"d": time_delta.days}
    d["h"], rem = divmod(time_delta.seconds, 3600)
    d["m"], d["s"] = divmod(rem, 60)
    return fmt.format(**d)