nofrag, frag = val.split('.')
nofrag_dt = datetime.datetime.strptime(nofrag, '%Y-%m-%dT%H:%M:%S')
dt = nofrag_dt.replace(microsecond=int(frag))
dt
string to datetime with fractional seconds, on Google App Engine