dt = datetime.datetime.strptime(dt, '%Y-%m-%dT%H:%M:%S')
us = int(us.rstrip('Z'), 10)
return dt + datetime.timedelta(microseconds=us)
How to convert python .isoformat() string back into datetime object