0

I've seen issues (1, 2) related to retrieving the milliseconds part of a QDateTime after inserting in MySQL database.

What's the proper way to do that(should I do QDateTime::toString and store it in a TIMESTAMP(3) field)?

Community
  • 1
  • 1
KcFnMi
  • 5,516
  • 10
  • 62
  • 136
  • I don't think you can just use QDateTime (as of Qt 5.5). Milliseconds support in MySQL is relatively a new feature and nobody has added the code necessary to read them back... see http://code.qt.io/cgit/qt/qtbase.git/tree/src/sql/drivers/mysql/qsql_mysql.cpp#n142 – peppe Jul 25 '15 at 13:34
  • I've made a reference to your comment [here](http://stackoverflow.com/questions/31582537/mysql-timestamp-to-qdatetime-with-milliseconds/31631751#31631751). – KcFnMi Jul 25 '15 at 22:39

0 Answers0