def _time_to_minutes(time_dhms):
    """ Converting time from 'd-hh:mm:ss' to total minutes """
    x = time_dhms.split('-')
    if len(x) > 1:
        days = int(x.pop(0))
    else:
        days = 0
    x = x[0].split(':')
    hours = int(x[0])
    minutes = int(x[1])
    
    # return number of minutes
    return days * (24 * 60) + hours * 60 + minutes