Struct qt_core::QTimeZone

source ·
#[repr(C)]
pub struct QTimeZone { /* private fields */ }
Expand description

The QTimeZone class converts between UTC and local time in a specific time zone.

C++ class: QTimeZone.

C++ documentation:

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 Qt::TimeSpec of Qt::TimeZone.

Note: For consistency with QDateTime, QTimeZone does not account for leap seconds.

IANA Time Zone IDs

QTimeZone uses the IANA time zone IDs as defined in the IANA Time Zone Database (http://www.iana.org/time-zones). This is to ensure a standard ID across all supported platforms. Most platforms support the IANA IDs and the IANA Database natively, but for Windows a mapping is required to the native IDs. See below for more details.

The IANA IDs can and do change on a regular basis, and can vary depending on how recently the host system data was updated. As such you cannot rely on any given ID existing on any host system. You must use availableTimeZoneIds() to determine what IANA IDs are available.

The IANA IDs and database are also know as the Olson IDs and database, named after their creator.

UTC Offset Time Zones

A default UTC time zone backend is provided which is always guaranteed to be available. This provides a set of generic Offset From UTC time zones in the range UTC-14:00 to UTC+14:00. These time zones can be created using either the standard ISO format names "UTC+00:00" as listed by availableTimeZoneIds(), or using the number of offset seconds.

Windows Time Zones

Windows native time zone support is severely limited compared to the standard IANA TZ Database. Windows time zones cover larger geographic areas and are thus less accurate in their conversions. They also do not support as much historic conversion data and so may only be accurate for the current year.

QTimeZone uses a conversion table derived form the Unicode CLDR data to map between IANA IDs and Windows IDs. Depending on your version of Windows and Qt, this table may not be able to provide a valid conversion, in which "UTC" will be returned.

QTimeZone provides a public API to use this conversion table. The Windows ID used is the Windows Registry Key for the time zone which is also the MS Exchange EWS ID as well, but is different to the Time Zone Name (TZID) and COD code used by MS Exchange in versions before 2007.

System Time Zone

QTimeZone does not support any concept of a system or default time zone. If you require a QDateTime that uses the current system time zone at any given moment then you should use a Qt::TimeSpec of Qt::LocalTime.

The method systemTimeZoneId() returns the current system IANA time zone ID which on Unix-like systems will always be correct. On Windows this ID is translated from the Windows system ID using an internal translation table and the user's selected country. As a consequence there is a small chance any Windows install may have IDs not known by Qt, in which case "UTC" will be returned.

Creating a new QTimeZone instance using the system time zone ID will only produce a fixed named copy of the time zone, it will not change if the system time zone changes.

Time Zone Offsets

The difference between UTC and the local time in a time zone is expressed as an offset in seconds from UTC, i.e. the number of seconds to add to UTC to obtain the local time. The total offset is comprised of two component parts, the standard time offset and the daylight-saving time offset. The standard time offset is the number of seconds to add to UTC to obtain standard time in the time zone. The daylight-saving time offset is the number of seconds to add to the standard time offset to obtain daylight-saving time (abbreviated DST and sometimes called "daylight time" or "summer time") in the time zone.

Note that the standard and DST offsets for a time zone may change over time as countries have changed DST laws or even their standard time offset.

License

This class includes data obtained from the CLDR data files under the terms of the Unicode Data Files and Software License. See Unicode CLDR (Unicode Common Locale Data Repository) for the details.

Implementations§

source§

impl QTimeZone

source

pub unsafe fn abbreviation( &self, at_date_time: impl CastInto<Ref<QDateTime>> ) -> CppBox<QString>

Returns the time zone abbreviation at the given atDateTime. The abbreviation may change depending on DST or even historical events.

Calls C++ function: QString QTimeZone::abbreviation(const QDateTime& atDateTime) const.

C++ documentation:

Returns the time zone abbreviation at the given atDateTime. The abbreviation may change depending on DST or even historical events.

Note that the abbreviation is not guaranteed to be unique to this time zone and should not be used in place of the ID or display name.

See also displayName().

source

pub unsafe fn available_time_zone_ids() -> CppBox<QListOfQByteArray>

Returns a list of all available IANA time zone IDs on this system.

Calls C++ function: static QList<QByteArray> QTimeZone::availableTimeZoneIds().

C++ documentation:

Returns a list of all available IANA time zone IDs on this system.

See also isTimeZoneIdAvailable().

source

pub unsafe fn available_time_zone_ids_country( country: Country ) -> CppBox<QListOfQByteArray>

Returns a list of all available IANA time zone IDs for a given country.

Calls C++ function: static QList<QByteArray> QTimeZone::availableTimeZoneIds(QLocale::Country country).

C++ documentation:

Returns a list of all available IANA time zone IDs for a given country.

As a special case, a country of Qt::AnyCountry returns those time zones that do not have any country related to them, such as UTC. If you require a list of all time zone IDs for all countries then use the standard availableTimeZoneIds() method.

See also isTimeZoneIdAvailable().

source

pub unsafe fn available_time_zone_ids_int( offset_seconds: c_int ) -> CppBox<QListOfQByteArray>

Returns a list of all available IANA time zone IDs with a given standard time offset of offsetSeconds.

Calls C++ function: static QList<QByteArray> QTimeZone::availableTimeZoneIds(int offsetSeconds).

C++ documentation:

Returns a list of all available IANA time zone IDs with a given standard time offset of offsetSeconds.

See also isTimeZoneIdAvailable().

source

pub unsafe fn comment(&self) -> CppBox<QString>

Returns any comment for the time zone.

Calls C++ function: QString QTimeZone::comment() const.

C++ documentation:

Returns any comment for the time zone.

A comment may be provided by the host platform to assist users in choosing the correct time zone. Depending on the platform this may not be localized.

source

pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QTimeZone>> ) -> Ref<QTimeZone>

Assignment operator, assign other to this.

Calls C++ function: QTimeZone& QTimeZone::operator=(const QTimeZone& other).

C++ documentation:

Assignment operator, assign other to this.

source

pub unsafe fn country(&self) -> Country

Returns the country for the time zone.

Calls C++ function: QLocale::Country QTimeZone::country() const.

C++ documentation:

Returns the country for the time zone.

source

pub unsafe fn daylight_time_offset( &self, at_date_time: impl CastInto<Ref<QDateTime>> ) -> c_int

Returns the daylight-saving time offset at the given atDateTime, i.e. the number of seconds to add to the standard time offset to obtain the local daylight-saving time.

Calls C++ function: int QTimeZone::daylightTimeOffset(const QDateTime& atDateTime) const.

C++ documentation:

Returns the daylight-saving time offset at the given atDateTime, i.e. the number of seconds to add to the standard time offset to obtain the local daylight-saving time.

For example, for the time zone "Europe/Berlin" the DST offset is +3600 seconds. During standard time daylightTimeOffset() will return 0, and when daylight-saving is in effect it will return +3600.

See also offsetFromUtc() and standardTimeOffset().

source

pub unsafe fn display_name_q_date_time_name_type_q_locale( &self, at_date_time: impl CastInto<Ref<QDateTime>>, name_type: NameType, locale: impl CastInto<Ref<QLocale>> ) -> CppBox<QString>

Returns the localized time zone display name at the given atDateTime for the given nameType in the given locale. The nameType and locale requested may not be supported on all platforms, in which case the best available option will be returned.

Calls C++ function: QString QTimeZone::displayName(const QDateTime& atDateTime, QTimeZone::NameType nameType = …, const QLocale& locale = …) const.

C++ documentation:

Returns the localized time zone display name at the given atDateTime for the given nameType in the given locale. The nameType and locale requested may not be supported on all platforms, in which case the best available option will be returned.

If the locale is not provided then the application default locale will be used.

The display name may change depending on DST or historical events.

See also abbreviation().

source

pub unsafe fn display_name_time_type_name_type_q_locale( &self, time_type: TimeType, name_type: NameType, locale: impl CastInto<Ref<QLocale>> ) -> CppBox<QString>

Returns the localized time zone display name for the given timeType and nameType in the given locale. The nameType and locale requested may not be supported on all platforms, in which case the best available option will be returned.

Calls C++ function: QString QTimeZone::displayName(QTimeZone::TimeType timeType, QTimeZone::NameType nameType = …, const QLocale& locale = …) const.

C++ documentation:

Returns the localized time zone display name for the given timeType and nameType in the given locale. The nameType and locale requested may not be supported on all platforms, in which case the best available option will be returned.

If the locale is not provided then the application default locale will be used.

Where the time zone display names have changed over time then the most recent names will be used.

See also abbreviation().

source

pub unsafe fn display_name_q_date_time_name_type( &self, at_date_time: impl CastInto<Ref<QDateTime>>, name_type: NameType ) -> CppBox<QString>

Returns the localized time zone display name at the given atDateTime for the given nameType in the given locale. The nameType and locale requested may not be supported on all platforms, in which case the best available option will be returned.

Calls C++ function: QString QTimeZone::displayName(const QDateTime& atDateTime, QTimeZone::NameType nameType = …) const.

C++ documentation:

Returns the localized time zone display name at the given atDateTime for the given nameType in the given locale. The nameType and locale requested may not be supported on all platforms, in which case the best available option will be returned.

If the locale is not provided then the application default locale will be used.

The display name may change depending on DST or historical events.

See also abbreviation().

source

pub unsafe fn display_name_q_date_time( &self, at_date_time: impl CastInto<Ref<QDateTime>> ) -> CppBox<QString>

Returns the localized time zone display name at the given atDateTime for the given nameType in the given locale. The nameType and locale requested may not be supported on all platforms, in which case the best available option will be returned.

Calls C++ function: QString QTimeZone::displayName(const QDateTime& atDateTime) const.

C++ documentation:

Returns the localized time zone display name at the given atDateTime for the given nameType in the given locale. The nameType and locale requested may not be supported on all platforms, in which case the best available option will be returned.

If the locale is not provided then the application default locale will be used.

The display name may change depending on DST or historical events.

See also abbreviation().

source

pub unsafe fn display_name_time_type_name_type( &self, time_type: TimeType, name_type: NameType ) -> CppBox<QString>

Returns the localized time zone display name for the given timeType and nameType in the given locale. The nameType and locale requested may not be supported on all platforms, in which case the best available option will be returned.

Calls C++ function: QString QTimeZone::displayName(QTimeZone::TimeType timeType, QTimeZone::NameType nameType = …) const.

C++ documentation:

Returns the localized time zone display name for the given timeType and nameType in the given locale. The nameType and locale requested may not be supported on all platforms, in which case the best available option will be returned.

If the locale is not provided then the application default locale will be used.

Where the time zone display names have changed over time then the most recent names will be used.

See also abbreviation().

source

pub unsafe fn display_name_time_type( &self, time_type: TimeType ) -> CppBox<QString>

Returns the localized time zone display name for the given timeType and nameType in the given locale. The nameType and locale requested may not be supported on all platforms, in which case the best available option will be returned.

Calls C++ function: QString QTimeZone::displayName(QTimeZone::TimeType timeType) const.

C++ documentation:

Returns the localized time zone display name for the given timeType and nameType in the given locale. The nameType and locale requested may not be supported on all platforms, in which case the best available option will be returned.

If the locale is not provided then the application default locale will be used.

Where the time zone display names have changed over time then the most recent names will be used.

See also abbreviation().

source

pub unsafe fn has_daylight_time(&self) -> bool

Returns true if the time zone has practiced daylight-saving at any time.

Calls C++ function: bool QTimeZone::hasDaylightTime() const.

C++ documentation:

Returns true if the time zone has practiced daylight-saving at any time.

See also isDaylightTime() and daylightTimeOffset().

source

pub unsafe fn has_transitions(&self) -> bool

Returns true if the system backend supports obtaining transitions.

Calls C++ function: bool QTimeZone::hasTransitions() const.

C++ documentation:

Returns true if the system backend supports obtaining transitions.

Transitions are changes in the time-zone: these happen when DST turns on or off and when authorities alter the offsets for the time-zone.

See also nextTransition(), previousTransition(), and transitions().

source

pub unsafe fn iana_id_to_windows_id( iana_id: impl CastInto<Ref<QByteArray>> ) -> CppBox<QByteArray>

Returns the Windows ID equivalent to the given ianaId.

Calls C++ function: static QByteArray QTimeZone::ianaIdToWindowsId(const QByteArray& ianaId).

C++ documentation:

Returns the Windows ID equivalent to the given ianaId.

See also windowsIdToDefaultIanaId() and windowsIdToIanaIds().

source

pub unsafe fn id(&self) -> CppBox<QByteArray>

Returns the IANA ID for the time zone.

Calls C++ function: QByteArray QTimeZone::id() const.

C++ documentation:

Returns the IANA ID for the time zone.

IANA IDs are used on all platforms. On Windows these are translated from the Windows ID into the closest IANA ID for the time zone and country.

source

pub unsafe fn is_daylight_time( &self, at_date_time: impl CastInto<Ref<QDateTime>> ) -> bool

Returns true if daylight-saving was in effect at the given atDateTime.

Calls C++ function: bool QTimeZone::isDaylightTime(const QDateTime& atDateTime) const.

C++ documentation:

Returns true if daylight-saving was in effect at the given atDateTime.

See also hasDaylightTime() and daylightTimeOffset().

source

pub unsafe fn is_time_zone_id_available( iana_id: impl CastInto<Ref<QByteArray>> ) -> bool

Returns true if a given time zone ianaId is available on this system.

Calls C++ function: static bool QTimeZone::isTimeZoneIdAvailable(const QByteArray& ianaId).

C++ documentation:

Returns true if a given time zone ianaId is available on this system.

See also availableTimeZoneIds().

source

pub unsafe fn is_valid(&self) -> bool

Returns true if this time zone is valid.

Calls C++ function: bool QTimeZone::isValid() const.

C++ documentation:

Returns true if this time zone is valid.

source

pub unsafe fn new() -> CppBox<QTimeZone>

Create a null/invalid time zone instance.

Calls C++ function: [constructor] void QTimeZone::QTimeZone().

C++ documentation:

Create a null/invalid time zone instance.

source

pub unsafe fn from_q_byte_array( iana_id: impl CastInto<Ref<QByteArray>> ) -> CppBox<QTimeZone>

Creates an instance of the requested time zone ianaId.

Calls C++ function: [constructor] void QTimeZone::QTimeZone(const QByteArray& ianaId).

C++ documentation:

Creates an instance of the requested time zone ianaId.

The ID must be one of the available system IDs otherwise an invalid time zone will be returned.

See also availableTimeZoneIds().

source

pub unsafe fn from_int(offset_seconds: c_int) -> CppBox<QTimeZone>

Creates an instance of a time zone with the requested Offset from UTC of offsetSeconds.

Calls C++ function: [constructor] void QTimeZone::QTimeZone(int offsetSeconds).

C++ documentation:

Creates an instance of a time zone with the requested Offset from UTC of offsetSeconds.

The offsetSeconds from UTC must be in the range -14 hours to +14 hours otherwise an invalid time zone will be returned.

source

pub unsafe fn from_q_byte_array_int2_q_string_country_q_string( zone_id: impl CastInto<Ref<QByteArray>>, offset_seconds: c_int, name: impl CastInto<Ref<QString>>, abbreviation: impl CastInto<Ref<QString>>, country: Country, comment: impl CastInto<Ref<QString>> ) -> CppBox<QTimeZone>

Creates a custom time zone with an ID of ianaId and an offset from UTC of offsetSeconds. The name will be the name used by displayName() for the LongName, the abbreviation will be used by displayName() for the ShortName and by abbreviation(), and the optional country will be used by country(). The comment is an optional note that may be displayed in a GUI to assist users in selecting a time zone.

Calls C++ function: [constructor] void QTimeZone::QTimeZone(const QByteArray& zoneId, int offsetSeconds, const QString& name, const QString& abbreviation, QLocale::Country country = …, const QString& comment = …).

C++ documentation:

Creates a custom time zone with an ID of ianaId and an offset from UTC of offsetSeconds. The name will be the name used by displayName() for the LongName, the abbreviation will be used by displayName() for the ShortName and by abbreviation(), and the optional country will be used by country(). The comment is an optional note that may be displayed in a GUI to assist users in selecting a time zone.

The ianaId must not be one of the available system IDs returned by availableTimeZoneIds(). The offsetSeconds from UTC must be in the range -14 hours to +14 hours.

If the custom time zone does not have a specific country then set it to the default value of QLocale::AnyCountry.

source

pub unsafe fn from_q_byte_array_int2_q_string_country( zone_id: impl CastInto<Ref<QByteArray>>, offset_seconds: c_int, name: impl CastInto<Ref<QString>>, abbreviation: impl CastInto<Ref<QString>>, country: Country ) -> CppBox<QTimeZone>

Creates a custom time zone with an ID of ianaId and an offset from UTC of offsetSeconds. The name will be the name used by displayName() for the LongName, the abbreviation will be used by displayName() for the ShortName and by abbreviation(), and the optional country will be used by country(). The comment is an optional note that may be displayed in a GUI to assist users in selecting a time zone.

Calls C++ function: [constructor] void QTimeZone::QTimeZone(const QByteArray& zoneId, int offsetSeconds, const QString& name, const QString& abbreviation, QLocale::Country country = …).

C++ documentation:

Creates a custom time zone with an ID of ianaId and an offset from UTC of offsetSeconds. The name will be the name used by displayName() for the LongName, the abbreviation will be used by displayName() for the ShortName and by abbreviation(), and the optional country will be used by country(). The comment is an optional note that may be displayed in a GUI to assist users in selecting a time zone.

The ianaId must not be one of the available system IDs returned by availableTimeZoneIds(). The offsetSeconds from UTC must be in the range -14 hours to +14 hours.

If the custom time zone does not have a specific country then set it to the default value of QLocale::AnyCountry.

source

pub unsafe fn from_q_byte_array_int2_q_string( zone_id: impl CastInto<Ref<QByteArray>>, offset_seconds: c_int, name: impl CastInto<Ref<QString>>, abbreviation: impl CastInto<Ref<QString>> ) -> CppBox<QTimeZone>

Creates a custom time zone with an ID of ianaId and an offset from UTC of offsetSeconds. The name will be the name used by displayName() for the LongName, the abbreviation will be used by displayName() for the ShortName and by abbreviation(), and the optional country will be used by country(). The comment is an optional note that may be displayed in a GUI to assist users in selecting a time zone.

Calls C++ function: [constructor] void QTimeZone::QTimeZone(const QByteArray& zoneId, int offsetSeconds, const QString& name, const QString& abbreviation).

C++ documentation:

Creates a custom time zone with an ID of ianaId and an offset from UTC of offsetSeconds. The name will be the name used by displayName() for the LongName, the abbreviation will be used by displayName() for the ShortName and by abbreviation(), and the optional country will be used by country(). The comment is an optional note that may be displayed in a GUI to assist users in selecting a time zone.

The ianaId must not be one of the available system IDs returned by availableTimeZoneIds(). The offsetSeconds from UTC must be in the range -14 hours to +14 hours.

If the custom time zone does not have a specific country then set it to the default value of QLocale::AnyCountry.

source

pub unsafe fn new_copy( other: impl CastInto<Ref<QTimeZone>> ) -> CppBox<QTimeZone>

Copy constructor, copy other to this.

Calls C++ function: [constructor] void QTimeZone::QTimeZone(const QTimeZone& other).

C++ documentation:

Copy constructor, copy other to this.

source

pub unsafe fn next_transition( &self, after_date_time: impl CastInto<Ref<QDateTime>> ) -> CppBox<OffsetData>

Returns the first time zone Transition after the given afterDateTime. This is most useful when you have a Transition time and wish to find the Transition after it.

Calls C++ function: QTimeZone::OffsetData QTimeZone::nextTransition(const QDateTime& afterDateTime) const.

C++ documentation:

Returns the first time zone Transition after the given afterDateTime. This is most useful when you have a Transition time and wish to find the Transition after it.

If there is no transition after the given afterDateTime then an invalid OffsetData will be returned with an invalid QDateTime.

The given afterDateTime is exclusive.

See also hasTransitions(), previousTransition(), and transitions().

source

pub unsafe fn offset_data( &self, for_date_time: impl CastInto<Ref<QDateTime>> ) -> CppBox<OffsetData>

Returns the effective offset details at the given forDateTime. This is the equivalent of calling offsetFromUtc(), abbreviation(), etc individually but is more efficient.

Calls C++ function: QTimeZone::OffsetData QTimeZone::offsetData(const QDateTime& forDateTime) const.

C++ documentation:

Returns the effective offset details at the given forDateTime. This is the equivalent of calling offsetFromUtc(), abbreviation(), etc individually but is more efficient.

See also offsetFromUtc(), standardTimeOffset(), daylightTimeOffset(), and abbreviation().

source

pub unsafe fn offset_from_utc( &self, at_date_time: impl CastInto<Ref<QDateTime>> ) -> c_int

Returns the total effective offset at the given atDateTime, i.e. the number of seconds to add to UTC to obtain the local time. This includes any DST offset that may be in effect, i.e. it is the sum of standardTimeOffset() and daylightTimeOffset() for the given datetime.

Calls C++ function: int QTimeZone::offsetFromUtc(const QDateTime& atDateTime) const.

C++ documentation:

Returns the total effective offset at the given atDateTime, i.e. the number of seconds to add to UTC to obtain the local time. This includes any DST offset that may be in effect, i.e. it is the sum of standardTimeOffset() and daylightTimeOffset() for the given datetime.

For example, for the time zone "Europe/Berlin" the standard time offset is +3600 seconds and the DST offset is +3600 seconds. During standard time offsetFromUtc() will return +3600 (UTC+01:00), and during DST it will return +7200 (UTC+02:00).

See also standardTimeOffset() and daylightTimeOffset().

source

pub unsafe fn previous_transition( &self, before_date_time: impl CastInto<Ref<QDateTime>> ) -> CppBox<OffsetData>

Returns the first time zone Transition before the given beforeDateTime. This is most useful when you have a Transition time and wish to find the Transition before it.

Calls C++ function: QTimeZone::OffsetData QTimeZone::previousTransition(const QDateTime& beforeDateTime) const.

C++ documentation:

Returns the first time zone Transition before the given beforeDateTime. This is most useful when you have a Transition time and wish to find the Transition before it.

If there is no transition before the given beforeDateTime then an invalid OffsetData will be returned with an invalid QDateTime.

The given beforeDateTime is exclusive.

See also hasTransitions(), nextTransition(), and transitions().

source

pub unsafe fn standard_time_offset( &self, at_date_time: impl CastInto<Ref<QDateTime>> ) -> c_int

Returns the standard time offset at the given atDateTime, i.e. the number of seconds to add to UTC to obtain the local Standard Time. This excludes any DST offset that may be in effect.

Calls C++ function: int QTimeZone::standardTimeOffset(const QDateTime& atDateTime) const.

C++ documentation:

Returns the standard time offset at the given atDateTime, i.e. the number of seconds to add to UTC to obtain the local Standard Time. This excludes any DST offset that may be in effect.

For example, for the time zone "Europe/Berlin" the standard time offset is +3600 seconds. During both standard and DST offsetFromUtc() will return +3600 (UTC+01:00).

See also offsetFromUtc() and daylightTimeOffset().

source

pub unsafe fn swap(&self, other: impl CastInto<Ref<QTimeZone>>)

Swaps this time zone instance with other. This function is very fast and never fails.

Calls C++ function: void QTimeZone::swap(QTimeZone& other).

C++ documentation:

Swaps this time zone instance with other. This function is very fast and never fails.

source

pub unsafe fn system_time_zone() -> CppBox<QTimeZone>

Returns a QTimeZone object that refers to the local system time, as specified by systemTimeZoneId().

Calls C++ function: static QTimeZone QTimeZone::systemTimeZone().

C++ documentation:

Returns a QTimeZone object that refers to the local system time, as specified by systemTimeZoneId().

This function was introduced in Qt 5.5.

See also utc().

source

pub unsafe fn system_time_zone_id() -> CppBox<QByteArray>

Returns the current system time zone IANA ID.

Calls C++ function: static QByteArray QTimeZone::systemTimeZoneId().

C++ documentation:

Returns the current system time zone IANA ID.

On Windows this ID is translated from the Windows ID using an internal translation table and the user's selected country. As a consequence there is a small chance any Windows install may have IDs not known by Qt, in which case "UTC" will be returned.

source

pub unsafe fn transitions( &self, from_date_time: impl CastInto<Ref<QDateTime>>, to_date_time: impl CastInto<Ref<QDateTime>> ) -> CppBox<QVectorOfOffsetData>

Returns a list of all time zone transitions between the given datetimes.

Calls C++ function: QVector<QTimeZone::OffsetData> QTimeZone::transitions(const QDateTime& fromDateTime, const QDateTime& toDateTime) const.

C++ documentation:

Returns a list of all time zone transitions between the given datetimes.

The given fromDateTime and toDateTime are inclusive.

See also hasTransitions(), nextTransition(), and previousTransition().

source

pub unsafe fn utc() -> CppBox<QTimeZone>

Returns a QTimeZone object that refers to UTC (Universal Time Coordinated).

Calls C++ function: static QTimeZone QTimeZone::utc().

C++ documentation:

Returns a QTimeZone object that refers to UTC (Universal Time Coordinated).

This function was introduced in Qt 5.5.

See also systemTimeZone().

source

pub unsafe fn windows_id_to_default_iana_id_1a( windows_id: impl CastInto<Ref<QByteArray>> ) -> CppBox<QByteArray>

Returns the default IANA ID for a given windowsId.

Calls C++ function: static QByteArray QTimeZone::windowsIdToDefaultIanaId(const QByteArray& windowsId).

C++ documentation:

Returns the default IANA ID for a given windowsId.

Because a Windows ID can cover several IANA IDs in several different countries, this function returns the most frequently used IANA ID with no regard for the country and should thus be used with care. It is usually best to request the default for a specific country.

See also ianaIdToWindowsId() and windowsIdToIanaIds().

source

pub unsafe fn windows_id_to_default_iana_id_2a( windows_id: impl CastInto<Ref<QByteArray>>, country: Country ) -> CppBox<QByteArray>

Returns the default IANA ID for a given windowsId and country.

Calls C++ function: static QByteArray QTimeZone::windowsIdToDefaultIanaId(const QByteArray& windowsId, QLocale::Country country).

C++ documentation:

Returns the default IANA ID for a given windowsId and country.

Because a Windows ID can cover several IANA IDs within a given country, the most frequently used IANA ID in that country is returned.

As a special case, QLocale::AnyCountry returns the default of those IANA IDs that do not have any specific country.

See also ianaIdToWindowsId() and windowsIdToIanaIds().

source

pub unsafe fn windows_id_to_iana_ids_1a( windows_id: impl CastInto<Ref<QByteArray>> ) -> CppBox<QListOfQByteArray>

Returns all the IANA IDs for a given windowsId.

Calls C++ function: static QList<QByteArray> QTimeZone::windowsIdToIanaIds(const QByteArray& windowsId).

C++ documentation:

Returns all the IANA IDs for a given windowsId.

The returned list is sorted alphabetically.

See also ianaIdToWindowsId() and windowsIdToDefaultIanaId().

source

pub unsafe fn windows_id_to_iana_ids_2a( windows_id: impl CastInto<Ref<QByteArray>>, country: Country ) -> CppBox<QListOfQByteArray>

Returns all the IANA IDs for a given windowsId and country.

Calls C++ function: static QList<QByteArray> QTimeZone::windowsIdToIanaIds(const QByteArray& windowsId, QLocale::Country country).

C++ documentation:

Returns all the IANA IDs for a given windowsId and country.

As a special case QLocale::AnyCountry returns those IANA IDs that do not have any specific country.

The returned list is in order of frequency of usage, i.e. larger zones within a country are listed first.

See also ianaIdToWindowsId() and windowsIdToDefaultIanaId().

Trait Implementations§

source§

impl CppDeletable for QTimeZone

source§

unsafe fn delete(&self)

Destroys the time zone.

Calls C++ function: [destructor] void QTimeZone::~QTimeZone().

C++ documentation:

Destroys the time zone.

source§

impl PartialEq<Ref<QTimeZone>> for QTimeZone

source§

fn eq(&self, other: &Ref<QTimeZone>) -> bool

Returns true if this time zone is equal to the other time zone.

Calls C++ function: bool QTimeZone::operator==(const QTimeZone& other) const.

C++ documentation:

Returns true if this time zone is equal to the other time zone.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.