diff options
author | Cristian Tarsoaga <cristian.tarsoaga@gmail.com> | 2013-10-13 23:33:15 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-26 01:43:41 +0200 |
commit | 1d039184543c3c1079a56e98ca22d9774166ed3f (patch) | |
tree | ab06affc38b37e316fa094413f3e5997cd5d473e /src/sql | |
parent | 076f931de529a4faad980f0f60a3b4419b733e5a (diff) |
Fix - psql driver must format qdatetime using iso
QDateTime must be formatted as ISO8601 specifies, date/month must pe padded with 0 until width is 2
Task-number:QTBUG-33389
Change-Id: If07bcaa976ea3583369da3fd21ce442ee30e8c1f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/sql')
-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 9331f5c371..fd5990f3ee 100644 --- a/src/sql/drivers/psql/qsql_psql.cpp +++ b/src/sql/drivers/psql/qsql_psql.cpp @@ -1253,8 +1253,8 @@ QString QPSQLDriver::formatValue(const QSqlField &field, bool trimStrings) const QTime tm = field.value().toDateTime().time(); // msecs need to be right aligned otherwise psql interprets 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('\''); |