擅长:python、mysql、java
<p>对我来说它直接和</p>
<pre><code>update test set last_sent = '2013-05-13 15:12:51' where id = 'someid'
</code></pre>
<p>不需要改变什么。因此,在Python中,可以使用datetime值作为字符串:</p>
<pre><code>cursor.execute("UPDATE test SET ts=:ts WHERE id=:id;",
dict(ts=your_datetime.isoformat(), id=id))
</code></pre>