3#include <QtCore/QtGlobal>
4#include <QtCore/QtEndian>
5#include <QtCore/QDateTime>
33 quint32 s = ntpMSecs / 1000;
34 quint32 f = 0x100000000ll * (ntpMSecs % 1000) / 1000;
47 quint32 s = qFromBigEndian(
seconds);
48 quint32 f = qFromBigEndian(
fraction);
51 qint64 ntpMSecs = s * 1000ll + f * 1000ll / 0x100000000ll;
54 return Time(Time::MILLISECOND * (ntpMSecs - 2208988800000LL));
57 static_assert(
sizeof(NtpTimestamp) == 8);
Represents a timestamp with utilities for manipulation and conversion.
uint08 getMilliseconds() const
Gets the timestamp in milliseconds since 1970.
The primary namespace for the NDEVR SDK.
NtpTimestamp(const Time &dateTime)
quint32 seconds
Number of seconds passed since Jan 1 1900, in big-endian format.
NtpTimestamp()
Default constructor.
quint32 fraction
Fractional time part, in 1/0xFFFFFFFFs of a second.