QTimeZone — PyQt Documentation v5.15.7 (original) (raw)
PyQt5.QtCore.QTimeZone
Description¶
The QTimeZone class converts between UTC and local time in a specific time zone.
This class provides a stateless calculator for time zone conversions between UTC and the local time in a specific time zone. By default it uses the host system time zone data to perform these conversions.
This class is primarily designed for use in QDateTime; most applications will not need to access this class directly and should instead use QDateTime with a TimeSpec of Qt::TimeZone.
Note: For consistency with QDateTime, QTimeZone does not account for leap seconds.
Classes¶
Enums¶
NameType
The type of time zone name.
Member | Value | Description |
---|---|---|
DefaultName | 0 | The default form of the time zone name, e.g. , or |
LongName | 1 | The long form of the time zone name, e.g. “Central European Time” |
OffsetName | 3 | The standard ISO offset form of the time zone name, e.g. “UTC+01:00” |
ShortName | 2 | The short form of the time zone name, usually an abbreviation, e.g. “CET” |
TimeType
The type of time zone time, for example when requesting the name. In time zones that do not apply DST, all three values may return the same result.
Member | Value | Description |
---|---|---|
DaylightTime | 1 | A time when Daylight-Saving is in effect. For example when formatting a display name this will show something like “Pacific daylight-saving time”. |
GenericTime | 2 | A time which is not specifically Standard or Daylight-Saving time, either an unknown time or a neutral form. For example when formatting a display name this will show something like “Pacific Time”. |
StandardTime | 0 | The standard time in a time zone, i.e. when Daylight-Saving is not in effect. For example when formatting a display name this will show something like “Pacific Standard Time”. |
Methods¶
__init__()
TODO
__init__(Union[QByteArray, bytes, bytearray])
TODO
__init__(int)
TODO
__init__(QTimeZone)
TODO
__init__(Union[QByteArray, bytes, bytearray], int, str, str, country: Country = AnyCountry, comment: str = '')
TODO
abbreviation(Union[QDateTime, datetime.datetime]) → str
TODO
@staticmethod
availableTimeZoneIds() → List[QByteArray]
TODO
@staticmethod
availableTimeZoneIds(Country) → List[QByteArray]
TODO
@staticmethod
availableTimeZoneIds(int) → List[QByteArray]
TODO
TODO
country() → Country
TODO
daylightTimeOffset(Union[QDateTime, datetime.datetime]) → int
TODO
displayName(Union[QDateTime, datetime.datetime], nameType: NameType = DefaultName, locale: QLocale = QLocale()) → str
TODO
displayName(TimeType, nameType: NameType = DefaultName, locale: QLocale = QLocale()) → str
TODO
__eq__(QTimeZone) → bool
TODO
hasDaylightTime() → bool
TODO
hasTransitions() → bool
TODO
@staticmethod
ianaIdToWindowsId(Union[QByteArray, bytes, bytearray]) → QByteArray
TODO
id() → QByteArray
TODO
isDaylightTime(Union[QDateTime, datetime.datetime]) → bool
TODO
@staticmethod
isTimeZoneIdAvailable(Union[QByteArray, bytes, bytearray]) → bool
TODO
isValid() → bool
TODO
__ne__(QTimeZone) → bool
TODO
nextTransition(Union[QDateTime, datetime.datetime]) → OffsetData
TODO
offsetData(Union[QDateTime, datetime.datetime]) → OffsetData
TODO
offsetFromUtc(Union[QDateTime, datetime.datetime]) → int
TODO
previousTransition(Union[QDateTime, datetime.datetime]) → OffsetData
TODO
standardTimeOffset(Union[QDateTime, datetime.datetime]) → int
TODO
swap(QTimeZone)
TODO
@staticmethod
systemTimeZone() → QTimeZone
TODO
@staticmethod
systemTimeZoneId() → QByteArray
TODO
transitions(Union[QDateTime, datetime.datetime], Union[QDateTime, datetime.datetime]) → List[OffsetData]
TODO
@staticmethod
utc() → QTimeZone
TODO
@staticmethod
windowsIdToDefaultIanaId(Union[QByteArray, bytes, bytearray]) → QByteArray
TODO
@staticmethod
windowsIdToDefaultIanaId(Union[QByteArray, bytes, bytearray], Country) → QByteArray
TODO
@staticmethod
windowsIdToIanaIds(Union[QByteArray, bytes, bytearray]) → List[QByteArray]
TODO
@staticmethod
windowsIdToIanaIds(Union[QByteArray, bytes, bytearray], Country) → List[QByteArray]
TODO