I&#39;m trying to format Python datetime objects into strings using QLocale, but it seems that under SIP API v2, the time information is lost? Are datetime objects being interpreted as QDate rather than QDateTime? Here&#39;s an example:<br>

<br>#################<br># API v1<br>#################<br>from PyQt4.QtCore import *<br>locale = QLocale()<br>locale.toString(QDateTime.currentDateTime(), locale.dateTimeFormat())<br># returns PyQt4.QtCore.QString(u&#39;Tuesday, 20 April 2010 15:06:19 &#39;)<br>

<br>#################<br>
# API v2<br>
#################<br>import sip<br>sip.setapi(&quot;QString&quot;, 2)<br>sip.setapi(&quot;QDate&quot;, 2)<br>sip.setapi(&quot;QDateTime&quot;, 2)<br>sip.setapi(&quot;QTime&quot;, 2)<br>from PyQt4.QtCore import *<br>import datetime<br>

locale = QLocale()<br>locale.toString(datetime.datetime.now(), locale.dateTimeFormat())<br># returns u&#39;Tuesday, 20 April 2010 HH:mm:ss &#39;<br><br>