• TimeManager
  • TimeManager Class

    (nymeaserver::TimeManager)

    Describes the centralized time manager of nymea. More...

    Header: #include <TimeManager>
    Inherits:

    Public Functions

    TimeManager(const QByteArray & timeZone, QObject * parent = 0)
    QList<QByteArray> availableTimeZones() const
    QDate currentDate() const
    QDateTime currentDateTime() const
    QTime currentTime() const
    void setTime(const QDateTime & dateTime)
    bool setTimeZone(const QByteArray & timeZone = QTimeZone::systemTimeZoneId())
    void stopTimer()
    QByteArray timeZone() const

    Signals

    void dateTimeChanged(const QDateTime & dateTime)
    void tick()

    Detailed Description

    Describes the centralized time manager of nymea.

    Member Function Documentation

    TimeManager::TimeManager(const QByteArray & timeZone, QObject * parent = 0)

    Constructs a new TimeManager with the given timeZone and parent.

    QList<QByteArray> TimeManager::availableTimeZones() const

    Returns a list of available time zones on this system.

    QDate TimeManager::currentDate() const

    Returns the current date of this TimeManager.

    QDateTime TimeManager::currentDateTime() const

    Returns the current dateTime of this TimeManager.

    QTime TimeManager::currentTime() const

    Returns the current time of this TimeManager.

    [signal] void TimeManager::dateTimeChanged(const QDateTime & dateTime)

    Will be emitted when the dateTime has changed.

    void TimeManager::setTime(const QDateTime & dateTime)

    Set the current time of this TimeManager to the given dateTime. * *

    Note: This method should only be used in tests.

    bool TimeManager::setTimeZone(const QByteArray & timeZone = QTimeZone::systemTimeZoneId())

    Sets the timeZone of this TimeManager. Allowed values according to the IANA database. Returns false if the given timezone is not valid.

    See also timeZone().

    void TimeManager::stopTimer()

    Stop the time. * *

    Note: This method should only be used in tests.

    [signal] void TimeManager::tick()

    Represents the central time tick. Will be emitted every second.

    QByteArray TimeManager::timeZone() const

    Returns the time zone of this TimeManager.

    See also setTimeZone().