Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use QDateTime::currentDateTimeUtc() with Qt 4.7+

No sense in taking a system time in UTC, converting it to local time, and then converting it back to UTC when this is avoidable.
  • Loading branch information...
commit 19d609551ec23d6c061b9f72f5f399993b411877 1 parent 92cd056
@daniel-kristjansson daniel-kristjansson authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 mythtv/libs/libmythbase/mythdate.cpp
View
6 mythtv/libs/libmythbase/mythdate.cpp
@@ -1,3 +1,5 @@
+#include <QtGlobal>
+
#include "mythcorecontext.h"
#include "mythdate.h"
@@ -6,7 +8,11 @@ namespace MythDate
QDateTime current(bool stripped)
{
+#if QT_VERSION >= QT_VERSION_CHECK(4,7,0)
+ QDateTime rettime = QDateTime::currentDateTimeUtc();
+#else
QDateTime rettime = QDateTime::currentDateTime().toUTC();
+#endif
if (stripped)
rettime = rettime.addMSecs(-rettime.time().msec());
return rettime;

0 comments on commit 19d6095

Please sign in to comment.
Something went wrong with that request. Please try again.