aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorJonas Schnelli <jonas.schnelli@include7.ch>2015-06-21 10:25:00 +0200
committerJonas Schnelli <jonas.schnelli@include7.ch>2015-09-16 16:50:19 +0200
commitf0bcbc4c8a9918e5d240ba2736286cede76155f5 (patch)
tree0db327d1b79c4f8264989f6e856e4af04eefa6a6 /src/qt
parent6135309816208740888b25bc27ea123c1c825a04 (diff)
[Qt] bantable fix timestamp 64bit issue
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/bantablemodel.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/qt/bantablemodel.cpp b/src/qt/bantablemodel.cpp
index 3b71769ef3..615574cca7 100644
--- a/src/qt/bantablemodel.cpp
+++ b/src/qt/bantablemodel.cpp
@@ -118,13 +118,9 @@ QVariant BanTableModel::data(const QModelIndex &index, int role) const
case Address:
return QString::fromStdString(rec->subnet.ToString());
case Bantime:
- //show time in users local timezone, not 64bit compatible!
- //TODO find a way to support 64bit timestamps
- boost::posix_time::ptime pt1 = boost::posix_time::from_time_t(rec->bantil);
- boost::posix_time::ptime pt2 = boost::date_time::c_local_adjustor<boost::posix_time::ptime>::utc_to_local(pt1);
- std::stringstream ss;
- ss << pt2;
- return QString::fromStdString(ss.str());
+ QDateTime date = QDateTime::fromMSecsSinceEpoch(0);
+ date = date.addSecs(rec->bantil);
+ return date.toString(Qt::SystemLocaleShortDate);
}
} else if (role == Qt::TextAlignmentRole) {
if (index.column() == Bantime)