diff options
author | Cristian Tarsoaga <cristian.tarsoaga@gmail.com> | 2014-05-01 20:25:33 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-05 18:36:47 (GMT) |
commit | 64a2bc8cebe36ed4e7ad430a23fc4bb536f790e1 (patch) | |
tree | e33b1504fcd2ea46df95e70d58a10efe0e2b23d7 | |
parent | b7a67ca944ae5f16a03b2992e9f6989e5e831edc (diff) | |
download | Qt-64a2bc8cebe36ed4e7ad430a23fc4bb536f790e1.zip Qt-64a2bc8cebe36ed4e7ad430a23fc4bb536f790e1.tar.gz Qt-64a2bc8cebe36ed4e7ad430a23fc4bb536f790e1.tar.bz2 |
Fix - psql driver must format qdatetime using iso
QDatetTime must be formatted as ISO8601 specifies, date/month must be padded with 0 until width is 2
Task-number:QTBUG-33389
Change-Id: I2db10e4b0f55a2666b2a12d7d8fcd03f13b96875
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
-rw-r--r-- | src/sql/drivers/psql/qsql_psql.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sql/drivers/psql/qsql_psql.cpp b/src/sql/drivers/psql/qsql_psql.cpp index f05b450..a9fc71c 100644 --- a/src/sql/drivers/psql/qsql_psql.cpp +++ b/src/sql/drivers/psql/qsql_psql.cpp @@ -1235,8 +1235,8 @@ QString QPSQLDriver::formatValue(const QSqlField &field, bool trimStrings) const // msecs need to be right aligned otherwise psql // interpretes them wrong r = QLatin1Char('\'') + QString::number(dt.year()) + QLatin1Char('-') - + QString::number(dt.month()) + QLatin1Char('-') - + QString::number(dt.day()) + QLatin1Char(' ') + + QString::number(dt.month()).rightJustified(2, QLatin1Char('0')) + QLatin1Char('-') + + QString::number(dt.day()).rightJustified(2, QLatin1Char('0')) + QLatin1Char(' ') + tm.toString() + QLatin1Char('.') + QString::number(tm.msec()).rightJustified(3, QLatin1Char('0')) + QLatin1Char('\''); |