def time_to_human(seconds):
    """
    Convert time in seconds to human readable format.
    
    :returns: a string of the form "DD days, HH hours, MM minites and
    SS seconds".
    """
    assert seconds >= 0 #number of seconds should be nonnegative
    dd = int(seconds) // 86400 # days
    hh = (int(seconds) // 3600) % 24 # hours
    mm = (int(seconds) // 60) % 60 # minutes
    ss = seconds - (int(seconds) // 60) * 60 # seconds
    
    text = ""
    if dd:
        text += "%d days, " % dd
    if hh:
        text += "%d hours, " % hh
    if mm:
        text += "%d min, " % mm
    if ss:
        text += "%d sec" % ss
    
    return text