Make timestamp formatting use QVariant for better sorting by timestamp.

This commit is contained in:
Collin Kidder
2019-02-17 14:43:13 -05:00
parent b92b909fc4
commit f6269dd5f4
3 changed files with 15 additions and 6 deletions
+4 -4
View File
@@ -128,13 +128,13 @@ public:
return output;
}
static QString formatTimestamp(uint64_t timestamp)
static QVariant formatTimestamp(uint64_t timestamp)
{
if (!sysTimeMode) {
if (!secondsMode) return QString::number(timestamp);
else return QString::number((double)timestamp / 1000000.0, 'f', 6);
if (!secondsMode) return (unsigned long long)(timestamp);
else return (double)timestamp / 1000000.0;
}
else return QDateTime::fromMSecsSinceEpoch(timestamp / 1000).toString(timeFormat);
else return QDateTime::fromMSecsSinceEpoch(timestamp / 1000);
}
//parses the input string to grab as much of it as possible while staying alpha numeric