def _parse_iso_timestamp(entry):
 if (not isinstance(entry, (str, str_type))):
  raise ValueError(('parse_iso_timestamp() input must be a str, got a %s' % type(entry)))
 if ('.' in entry):
  (timestamp_str, microseconds) = entry.split('.')
 else:
  (timestamp_str, microseconds) = (entry, '000000')
 if ((len(microseconds) != 6) or (not microseconds.isdigit())):
  raise ValueError("timestamp's microseconds should be six digits")
 if (timestamp_str[10] == 'T'):
  timestamp_str = ((timestamp_str[:10] + ' ') + timestamp_str[11:])
 else:
  raise ValueError("timestamp didn't contain delimeter 'T' between date and time")
 timestamp = _parse_timestamp(timestamp_str)
 return (timestamp + datetime.timedelta(microseconds=int(microseconds)))

def _parse_iso_timestamp ( entry ) : if ( not isinstance ( entry , ( str , str_type ) ) ) : raise ValueError ( ( 'parse_iso_timestamp() input must be a str, got a %s' % type ( entry ) ) ) if ( '.' in entry ) : ( timestamp_str , microseconds ) = entry . split ( '.' ) else : ( timestamp_str , microseconds ) = ( entry , '000000' ) if ( ( len ( microseconds ) != 6 ) or ( not microseconds . isdigit ( ) ) ) : raise ValueError ( "timestamp's microseconds should be six digits" ) if ( timestamp_str [ 10 ] == 'T' ) : timestamp_str = ( ( timestamp_str [ : 10 ] + ' ' ) + timestamp_str [ 11 : ] ) else : raise ValueError ( "timestamp didn't contain delimeter 'T' between date and time" ) timestamp = _parse_timestamp ( timestamp_str ) return ( timestamp + datetime . timedelta ( microseconds = int ( microseconds ) ) )
parses the iso 8601 standard that provides for timestamps like .