code: def s_from_dhms(time):
      
      dhms_s = { 's' : 1, 'm' : 60, 'h' : 3600, 'd' : 86400 }
      time = time.lower()
      word_list = re.findall('\d*[^\d]*',time)
      seconds=0 
      for word in word_list:
          if word != '':
              sec = 1
              for t in list(dhms_s.keys()):
                  nw = word.replace(t,'')
                  if nw != word:
                      sec = dhms_s[t]
                      word = nw
                      break
              try:
                  seconds += int(word) * sec
              except:
                  raise RuntimeError('unknown format in timestring ' + time)
      return seconds
docs: return seconds from dhms