use to_date function to convert into date format. Somthing like this.
send_dt = datetime.utcnow()
query = "UPDATE mytable SET data='{}', send_datetime=to_date('{}','YYYY-MM-DD hh24:mi:ss.FF9') where id='{}'".format(value, str(send_dt), id)
or instead of calculating the date use the predefined function in the sql.
query = "UPDATE mytable SET data='{}', send_datetime=sysdate where id='{}'".format(value, id)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…