38 : QObject(),
TorcHTTPService(this, QStringLiteral(
"time"), QStringLiteral(
"time"),
TorcTime::staticMetaObject, QStringLiteral(
"Tick")),
40 m_lastTime(QDateTime::currentDateTime()),
46 m_timer.setInterval(1000);
54 return m_lastTime.toString(m_dateTimeFormat);
60 return m_lastTime.toUTC().toString(Qt::ISODate);
66 QDateTime timenow = QDateTime::currentDateTime();
67 qint64 difference = timenow.secsTo(m_lastTime);
72 if (qAbs(difference) > (30 * 60))
74 LOG(VB_GENERAL, LOG_WARNING, QStringLiteral(
"Detected change in system time"));
78 QString time = m_lastTime.toString(m_dateTimeFormat);
void currentTimeChanged(QString &Time)
TorcLocalContext * gLocalContext
QString GetCurrentTimeUTC(void)
A factory class for automatically running objects outside of the main loop.
friend class TorcTimeObject
virtual ~TorcTimeObject()
static void NotifyEvent(int Event)
#define TORC_ADMIN_LOW_PRIORITY
void SubscriberDeleted(QObject *Subscriber)
void HandleSubscriberDeleted(QObject *Subscriber)
QReadWriteLock m_httpServiceLock
A static class used to create the TorcTime singleton in the admin thread.
QString GetCurrentTime(void)
#define LOG(_MASK_, _LEVEL_, _STRING_)
A simple time service to confirm the time (and date) the system is currently operating with...