From 4cb5332e386b8d2aa6c14367fe7fd55e301e8cdf Mon Sep 17 00:00:00 2001 From: Sebastian Hoogen Date: Thu, 8 Jan 2015 09:09:28 +0100 Subject: [PATCH] make the Qt::ISODate workaround obvious by including the intended implmentation --- src/Base/TimeInfo.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Base/TimeInfo.cpp b/src/Base/TimeInfo.cpp index 9082728938..3c459a21ed 100644 --- a/src/Base/TimeInfo.cpp +++ b/src/Base/TimeInfo.cpp @@ -71,6 +71,10 @@ void TimeInfo::setTime_t (uint64_t seconds) std::string TimeInfo::currentDateTimeString() { +#if (QT_VERSION >= 0x050300) + return QDateTime::currentDateTime().toTimeSpec(Qt::OffsetFromUTC) + .toString(Qt::ISODate).toStdString(); +#else QDateTime local = QDateTime::currentDateTime(); QDateTime utc = local.toUTC(); utc.setTimeSpec(Qt::LocalTime); @@ -78,6 +82,7 @@ std::string TimeInfo::currentDateTimeString() local.setUtcOffset(utcOffset); QString dm = local.toString(Qt::ISODate); return dm.toStdString(); +#endif } std::string TimeInfo::diffTime(const TimeInfo &timeStart,const TimeInfo &timeEnd )