summaryrefslogtreecommitdiff
path: root/fetchpostsaction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fetchpostsaction.cpp')
-rw-r--r--fetchpostsaction.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/fetchpostsaction.cpp b/fetchpostsaction.cpp
index 1330f44..dbfaf41 100644
--- a/fetchpostsaction.cpp
+++ b/fetchpostsaction.cpp
@@ -132,9 +132,9 @@ void FetchPostsAction::handleFinishedCall()
query.bindValue(":post_author_name", unencodePostText(post["post_author_name"]));
query.bindValue(":can_edit", post["can_edit"].toBool() ? 1 : 0);
query.bindValue(":icon_url", post["icon_url"].toString());
- query.bindValue(":post_time", post["post_time"].toDateTime());
+ query.bindValue(":post_time", unencodeDateTime(post["post_time"]));
query.bindValue(":position", position);
- query.bindValue(":last_update_time", QDateTime::currentDateTime());
+ query.bindValue(":last_update_time", QDateTime::currentDateTimeUtc());
Q_ASSERT(position < total_post_num);
@@ -197,3 +197,10 @@ QString FetchPostsAction::unencodePostContent(const QVariant &v)
QString richText = _board->bbcodeToRichText(unencodePostText(v));
return _board->parseSmilies(richText);
}
+
+QDateTime FetchPostsAction::unencodeDateTime(const QVariant &v)
+{
+ QDateTime dt = v.toDateTime();
+ dt.setTimeSpec(Qt::UTC);
+ return dt;
+}