code: func ParseUptime(uptime string) time.Duration {
  	var w, d, h, m, s int
  	if uptime == "never" || uptime == "<error>" {
  		return 0
  	} else if um := uptimeHourRE.FindStringSubmatch(uptime); um != nil {
  		h, _ = strconv.Atoi(um[1])
  		m, _ = strconv.Atoi(um[2])
  		s, _ = strconv.Atoi(um[3])
  	} else if um := uptimeDayRE.FindStringSubmatch(uptime); um != nil {
  		d, _ = strconv.Atoi(um[1])
  		h, _ = strconv.Atoi(um[2])
  		m, _ = strconv.Atoi(um[3])
  	} else if um := uptimeWeekRE.FindStringSubmatch(uptime); um != nil {
  		w, _ = strconv.Atoi(um[1])
  		d, _ = strconv.Atoi(um[2])
  		h, _ = strconv.Atoi(um[3])
  	} else {
  		return 0
  	}
  	return time.Duration(w)*168*time.Hour + time.Duration(d)*24*time.Hour +
  		time.Duration(h)*time.Hour + time.Duration(m)*time.Minute +
  		time.Duration(s)*time.Second
  }
docs: // ParseUptime parses an uptime string and returns the corresponding duration.
  // Time can come in five formats:
  //   07:05:56
  //   2d23h12m
  //   03w5d13h
  //   never
  //   <error>
  // See the peer_uptime function in quagga/linc/bgpd/bgpd.c.