def W3CDTF_to_datetime(formatted_string):
 match = re.match(RE_W3CDTF, formatted_string)
 digits = list(map(int, match.groups()[:6]))
 return datetime.datetime(*digits)

def W3CDTF_to_datetime ( formatted_string ) : match = re . match ( RE_W3CDTF , formatted_string ) digits = list ( map ( int , match . groups ( ) [ : 6 ] ) ) return datetime . datetime ( * digits )
convert from a timestamp string to a datetime object .