Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QLocalTime Namespace Reference

Classes

struct  SystemMillisRange
 

Functions

int getCurrentStandardUtcOffset ()
 
int getUtcOffset (qint64 atMSecsSinceEpoch)
 
QDateTimePrivate::ZoneState utcToLocal (qint64 utcMillis)
 
QString localTimeAbbbreviationAt (qint64 local, QDateTimePrivate::TransitionOptions resolve)
 
QDateTimePrivate::ZoneState mapLocalTime (qint64 local, QDateTimePrivate::TransitionOptions resolve)
 
SystemMillisRange computeSystemMillisRange ()
 

Function Documentation

◆ computeSystemMillisRange()

SystemMillisRange QLocalTime::computeSystemMillisRange ( )

Determine the range of the system time_t functions.

On MS-systems (where time_t is 64-bit by default), the start-point is the epoch, the end-point is the end of the year 3000 (for mktime(); for _localtime64_s it's 18 days later, but we ignore that here). Darwin's range runs from the beginning of 1900 to the end of its 64-bit time_t and Linux uses the full range of time_t (but this might still be 32-bit on some embedded systems).

(One potential constraint might appear to be the range of struct tm's int tm_year, only allowing time_t to represent times from the start of year 1900+INT_MIN to the end of year INT_MAX. The 26-bit number of seconds in a year means that a 64-bit time_t can indeed represent times outside the range of 32-bit years, by a factor of 32 - but the range of representable milliseconds needs ten more bits than that of seconds, so can't reach the ends of the 32-bit year range.)

Given the diversity of ranges, we conservatively estimate the actual supported range by experiment on the first call to qdatetime.cpp's millisInSystemRange() by exploration among the known candidates, converting the result to milliseconds and flagging whether each end is the qint64 range's bound (so millisInSystemRange will know not to try to pad beyond those bounds). The probed date-times are somewhat inside the range, but close enough to the relevant bound that we can be fairly sure the bound is reached, if the probe succeeds.

Definition at line 649 of file qlocaltime.cpp.

References computeSystemMillisRange(), QDateTime::First, QtPrivate::DateTimeConstants::JULIAN_DAY_FOR_EPOCH, QGregorianCalendar::julianFromParts(), QDateTime::Last, QtPrivate::DateTimeConstants::MSECS_PER_SEC, Q_ASSERT, Q_INT64_C, and qMkTime().

Referenced by computeSystemMillisRange(), and millisInSystemRange().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCurrentStandardUtcOffset()

Q_CORE_EXPORT int QLocalTime::getCurrentStandardUtcOffset ( )

Definition at line 469 of file qlocaltime.cpp.

References getCurrentStandardUtcOffset(), Q_ASSERT, qDebug, qMkTime(), qTzSet(), QtPrivate::DateTimeConstants::SECS_PER_DAY, QtPrivate::DateTimeConstants::SECS_PER_MIN, and time.

Referenced by getCurrentStandardUtcOffset(), and getLocalTZA().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUtcOffset()

Q_CORE_EXPORT int QLocalTime::getUtcOffset ( qint64 atMSecsSinceEpoch)

Definition at line 523 of file qlocaltime.cpp.

References QDateTimePrivate::expressUtcAsLocal(), and getUtcOffset().

Referenced by DaylightSavingTA(), and getUtcOffset().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ localTimeAbbbreviationAt()

QString QLocalTime::localTimeAbbbreviationAt ( qint64 local,
QDateTimePrivate::TransitionOptions resolve )

Definition at line 560 of file qlocaltime.cpp.

References QString::fromLocal8Bit(), localTimeAbbbreviationAt(), qTzName(), and resolve().

Referenced by QDateTimePrivate::localNameAtMillis(), and localTimeAbbbreviationAt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mapLocalTime()

QDateTimePrivate::ZoneState QLocalTime::mapLocalTime ( qint64 local,
QDateTimePrivate::TransitionOptions resolve )

Definition at line 572 of file qlocaltime.cpp.

References QDateTimePrivate::DaylightTime, QtPrivate::DateTimeConstants::JULIAN_DAY_FOR_EPOCH, mapLocalTime(), QtPrivate::DateTimeConstants::MSECS_PER_SEC, Q_ASSERT, Q_UNLIKELY, resolve(), QtPrivate::DateTimeConstants::SECS_PER_DAY, QDateTimePrivate::StandardTime, and QDateTimePrivate::UnknownDaylightTime.

Referenced by QDateTimePrivate::localStateAtMillis(), and mapLocalTime().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ utcToLocal()

QDateTimePrivate::ZoneState QLocalTime::utcToLocal ( qint64 utcMillis)

Definition at line 531 of file qlocaltime.cpp.

References QDateTimePrivate::DaylightTime, QtPrivate::DateTimeConstants::MSECS_PER_SEC, Q_ASSERT, Q_UNLIKELY, qLocalTime(), QtPrivate::DateTimeConstants::SECS_PER_DAY, QDateTimePrivate::StandardTime, and utcToLocal().

Referenced by QDateTimePrivate::expressUtcAsLocal(), and utcToLocal().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: