title: MySQL TIMESTAMP to QDateTime with milliseconds
body: <p>If I use a QSqlTableModel to access a MySQL database I can convert a TIMESTAMP field using the following:</p>
  
  <pre><code>QDateTime dateTime = index(section, column).data().toDateTime();
  QString str = dateTime.toString("yyyy-MM-dd hh:mm:ss.zzz");
  </code></pre>
  
  <p>So <code>str</code> shows, i.e. <code>2014-06-22 22:11:44.221</code>.
  But I want to access the database using QSqlQuerry, so I do:</p>
  
  <pre><code>QDateTime dateTime = query.value(column).toDateTime();
  str = dateTime.toString("yyyy-MM-dd hh:mm:ss.zzz");
  </code></pre>
  
  <p>But now I'm missing the milliseconds, <code>str</code> shows <code>2014-06-22 22:11:44.000</code>. What's the proper way to see the milliseconds?</p>
  
  <p>If I do <code>str = query.value(column).toString();</code> then I get <code>2014-06-22T22:11:44</code>.</p>