def GetDurationString(duration):
    """
    Convert the duration timedelta in a day:hour:min:sec string representation
    """    
    total_days, total_hours, total_minutes = duration.days, duration.seconds // 3600, duration.seconds // 60 % 60
    
    if total_days >= 1:    
        return "{0:02}d {1:02}h {2:02}m".format(total_days, total_hours, total_minutes)
    elif total_hours >= 1:
        return "{0:02}h {1:02}m".format(total_hours, total_minutes)
    else:
        return "{0:02}m".format(total_minutes)