From 1d039184543c3c1079a56e98ca22d9774166ed3f Mon Sep 17 00:00:00 2001 From: Cristian Tarsoaga Date: Sun, 13 Oct 2013 23:33:15 +0300 Subject: 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 --- src/sql/drivers/psql/qsql_psql.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sql') 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('\''); -- cgit v1.2.3