code: def parse_time(timestring):
      
      timestring = str(timestring).strip()
  
      for regex, pattern in TIME_FORMATS:
          if regex.match(timestring):
              found = regex.search(timestring).groupdict()
  
              dt = datetime.utcnow().strptime(found['matched'], pattern)
              dt = datetime.combine(date.today(), dt.time())
  
              if 'fraction' in found and found['fraction'] is not None:
                  dt = dt.replace(microsecond=int(found['fraction'][1:]))
  
              if 'timezone' in found and found['timezone'] is not None:
                  dt = dt.replace(tzinfo=Timezone(found.get('timezone', '')))
  
              return dt
  
      raise ParseError()
docs: Attepmts to parse an ISO8601 formatted ``timestring``.
  
      Returns a ``datetime.datetime`` object.