summaryrefslogtreecommitdiff
path: root/src/sql/drivers
diff options
context:
space:
mode:
authorCristian Tarsoaga <cristian.tarsoaga@gmail.com>2014-05-01 23:25:33 +0300
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-05 20:36:47 +0200
commit64a2bc8cebe36ed4e7ad430a23fc4bb536f790e1 (patch)
treee33b1504fcd2ea46df95e70d58a10efe0e2b23d7 /src/sql/drivers
parentb7a67ca944ae5f16a03b2992e9f6989e5e831edc (diff)
downloadqt4-tools-64a2bc8cebe36ed4e7ad430a23fc4bb536f790e1.tar.gz
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>
Diffstat (limited to 'src/sql/drivers')
-rw-r--r--src/sql/drivers/psql/qsql_psql.cpp4
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 f05b450081..a9fc71cf91 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('\'');