From 37139c96f04f781b053feefdbb5b3d28b2bcfc11 Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Thu, 4 Apr 2013 23:37:52 +0200 Subject: fix timezones on real device --- board.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'board.cpp') diff --git a/board.cpp b/board.cpp index bc9f4e7..5878475 100644 --- a/board.cpp +++ b/board.cpp @@ -211,7 +211,7 @@ QString Board::renderHumanDate(const QDateTime &dateTime) } } -QString Board::renderHumanTime(const QDateTime &dateTime) +QString Board::renderHumanDateTime(const QDateTime &dateTime) { const QDateTime now = QDateTime::currentDateTime(); QDateTime localDateTime = dateTime.toLocalTime(); @@ -478,7 +478,7 @@ bool Board::cleanDb() int total_rows = 0; q.prepare("DELETE FROM topics WHERE last_update_time < ?"); - q.bindValue(0, QDateTime::currentDateTime().addDays(-FORUM_TOPICS_CACHE)); + q.bindValue(0, QDateTime::currentDateTimeUtc().addDays(-FORUM_TOPICS_CACHE)); if (q.exec()) { total_rows += q.numRowsAffected(); } else { @@ -487,7 +487,7 @@ bool Board::cleanDb() q.prepare("DELETE FROM posts WHERE last_update_time < ?"); - q.bindValue(0, QDateTime::currentDateTime().addDays(-TOPIC_POSTS_CACHE)); + q.bindValue(0, QDateTime::currentDateTimeUtc().addDays(-TOPIC_POSTS_CACHE)); if (q.exec()) { total_rows += q.numRowsAffected(); } else { -- cgit v1.2.3