def convert_timedelta(duration):
    """
    Return time duration as formatted string.

    Args:
        duration (timedelta): :class:`timedelta` object representing
            the difference between two :class:`datetime` objects

    Returns:
        str: string representation of the duration
    """
    _, seconds = duration.days, duration.seconds
    hours = seconds // 3600
    minutes = (seconds % 3600) // 60
    seconds = (seconds % 60)
    return '{}h:{}m:{}s'.format(hours, minutes, seconds)