![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qdatetime_p.h>
Classes | |
struct | ZoneState |
Public Types | |
enum | Spec { LocalUnknown = -1 , LocalStandard = 0 , LocalDST = 1 , UTC = 2 , OffsetFromUTC = 3 , TimeZone = 4 } |
enum | DaylightStatus { UnknownDaylightTime = -1 , StandardTime = 0 , DaylightTime = 1 } |
enum | StatusFlag { ShortData = 0x01 , ValidDate = 0x02 , ValidTime = 0x04 , ValidDateTime = 0x08 , TimeSpecMask = 0x30 , SetToStandardTime = 0x40 , SetToDaylightTime = 0x80 , ValidityMask = ValidDate | ValidTime | ValidDateTime , DaylightMask = SetToStandardTime | SetToDaylightTime } |
enum | TransitionOption { GapUseBefore = 2 , GapUseAfter = 4 , FoldUseBefore = 0x20 , FoldUseAfter = 0x40 , FlipForReverseDst = 0x400 , GapMask = GapUseBefore | GapUseAfter , FoldMask = FoldUseBefore | FoldUseAfter } |
enum | { TimeSpecShift = 4 } |
typedef QDateTime::ShortData | QDateTimeShortData |
typedef QDateTime::Data | QDateTimeData |
Static Public Member Functions | |
static QDateTime::Data | create (QDate toDate, QTime toTime, const QTimeZone &timeZone, QDateTime::TransitionResolution resolve) |
static ZoneState | expressUtcAsLocal (qint64 utcMSecs) |
static ZoneState | localStateAtMillis (qint64 millis, TransitionOptions resolve) |
static QString | localNameAtMillis (qint64 millis, DaylightStatus dst) |
Public Attributes | |
StatusFlags | m_status = StatusFlag(Qt::LocalTime << TimeSpecShift) |
qint64 | m_msecs = 0 |
int | m_offsetFromUtc = 0 |
QTimeZone | m_timeZone |
![]() | |
QAtomicInt | ref |
Additional Inherited Members | |
![]() | |
QSharedData () noexcept | |
Constructs a QSharedData object with a reference count of 0. | |
QSharedData (const QSharedData &) noexcept | |
Constructs a QSharedData object with reference count 0. | |
QSharedData & | operator= (const QSharedData &)=delete |
~QSharedData ()=default | |
Definition at line 34 of file qdatetime_p.h.
typedef QDateTime::Data QDateTimePrivate::QDateTimeData |
Definition at line 39 of file qdatetime_p.h.
typedef QDateTime::ShortData QDateTimePrivate::QDateTimeShortData |
Definition at line 38 of file qdatetime_p.h.
anonymous enum |
Enumerator | |
---|---|
TimeSpecShift |
Definition at line 92 of file qdatetime_p.h.
Enumerator | |
---|---|
UnknownDaylightTime | |
StandardTime | |
DaylightTime |
Definition at line 53 of file qdatetime_p.h.
Enumerator | |
---|---|
LocalUnknown | |
LocalStandard | |
LocalDST | |
UTC | |
OffsetFromUTC | |
TimeZone |
Definition at line 43 of file qdatetime_p.h.
Enumerator | |
---|---|
ShortData | |
ValidDate | |
ValidTime | |
ValidDateTime | |
TimeSpecMask | |
SetToStandardTime | |
SetToDaylightTime | |
ValidityMask | |
DaylightMask |
Definition at line 60 of file qdatetime_p.h.
This enumeration is used to resolve datetime combinations which fall in \l {Timezone transitions}. The transition is described as a "gap" if there are time representations skipped over by the zone, as is common in the "spring forward" transitions in many zones on entering daylight-saving time. The transition is described as a "fold" if there are time representations repeated in the zone, as in a "fall back" transition out of daylight-saving time.
When the options specified do not determine a resolution for a datetime, it is marked invalid.
The prepared option sets above are in fact composed from low-level atomic options. For each of gap and fold you can chose between two candidate times, one before or after the transition, based on the time requested; or you can pick the moment of transition, or the start or end of the transition interval. For a gap, the start and end of the interval are the moment of the transition, but for a repeated interval the start of the first pass is the start of the transition interval, the end of the second pass is the end of the transition interval and the moment of the transition itself is both the end of the first pass and the start of the second.
\value GapUseBefore For a time in a gap, use a time before the transition, as if stepping back from a later time. \value GapUseAfter For a time in a gap, use a time after the transition, as if stepping forward from an earlier time. \value FoldUseBefore For a repeated time, use the first candidate, which is before the transition. \value FoldUseAfter For a repeated time, use the second candidate, which is after the transition. \value FlipForReverseDst For "reversed" DST, this reverses the preceding four options (see below).
The last has no effect unless the "daylight-saving" time side of the transition is known to have a lower offset from UTC than the standard time side. (This is the "reversed" DST case of \l {Timezone transitions}.) In that case, if other options would select a time after the transition, a time before is used instead, and vice versa. This effectively turns a preference for the side with lower offset into a preference for the side that is officially standard time, even if it has higher offset; and conversely a preference for higher offset into a preference for daylight-saving time, even if it has a lower offset. This option has no effect on a resolution that selects the moment of transition or the start or end of the transition interval.
The result of combining more than one of the GapUse*
options is undefined; likewise for the FoldUse*
. Each of QDateTime's TransitionResolution values, aside from Reject, maps to a combination that incorporates one from each of these sets.
Enumerator | |
---|---|
GapUseBefore | |
GapUseAfter | |
FoldUseBefore | |
FoldUseAfter | |
FlipForReverseDst | |
GapMask | |
FoldMask |
Definition at line 77 of file qdatetime_p.h.
|
static |
Definition at line 3572 of file qdatetime.cpp.
|
static |
Definition at line 2818 of file qdatetime.cpp.
|
static |
Definition at line 2970 of file qdatetime.cpp.
|
static |
Definition at line 3002 of file qdatetime.cpp.
qint64 QDateTimePrivate::m_msecs = 0 |
Definition at line 121 of file qdatetime_p.h.
int QDateTimePrivate::m_offsetFromUtc = 0 |
Definition at line 122 of file qdatetime_p.h.
StatusFlags QDateTimePrivate::m_status = StatusFlag(Qt::LocalTime << TimeSpecShift) |
Definition at line 120 of file qdatetime_p.h.
QTimeZone QDateTimePrivate::m_timeZone |
Definition at line 123 of file qdatetime_p.h.