Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QtParseTimeZone Namespace Reference

A toolset for parsing time zone identification strings. More...

Classes

class  ParsedZone
 Describes a text fragment representing a timezone. More...

Functions

QList< ParsedZoneprefix (QStringView text, const QLocale &locale, qsizetype from, QtTemporalPattern::TemporalFieldFlags flags)

Variables

constexpr QtTemporalPattern::TemporalFieldFlags AnyOffsetForm
constexpr QtTemporalPattern::TemporalFieldFlags AnyGlobalZoneName
constexpr QtTemporalPattern::TemporalFieldFlags AnyZoneName
constexpr QtTemporalPattern::TemporalFieldFlags BasicColonDigitOffset
constexpr QtTemporalPattern::TemporalFieldFlags BasicDigitOnlyOffset
constexpr QtTemporalPattern::TemporalFieldFlags AllLegacyForm
constexpr QtTemporalPattern::TemporalFieldFlags AnyGlobalZoneForm
constexpr QtTemporalPattern::TemporalFieldFlags AnyZoneForm

Detailed Description

A toolset for parsing time zone identification strings.

Since
6.12

A time zone may be identified by an offset from UTC or, in various ways, by a name. This namespace provides a \l {QtParseTimeZone::}{prefix()} function to parse an initial portion of a string as such an identifier, controlled by configuration options provided by \l {QtTemporalPattern::TemporalFieldFlags}, along with several combinations of those options that select particular commonly-used choices.

The constants are of type \l {QtTemporalPattern::TemporalFieldFlags}: \list

  • AnyOffsetForm Enables all offset options.
  • BasicDigitOnlyOffset The Qt 'tt' offset format: HH or HHmm, no separator between the hour and minute fields, no UTC or GMT prefix, just the sequence of digits.
  • BasicColonDigitOffset The Qt 'ttt' offset format: HH or HH:mm, fields within the offset are separated by colons, there is no UTC or GMT prefix.
  • AnyZoneName The Qt 'tttt' format: the IANA ID or localized long name of the zone.
  • AllLegacyForm The Qt 't' format: any zone representation supported up to Qt 6.10.
  • AnyZoneForm Enables all options.

\endlist

Function Documentation

◆ prefix()

Q_AUTOTEST_EXPORT QList< ParsedZone > QtParseTimeZone::prefix ( QStringView text,
const QLocale & locale,
qsizetype from,
QtTemporalPattern::TemporalFieldFlags flags )
Since
6.12 Parses an initial portion of text as a timezone, as described by locale

The acceptable forms of a timezone text are controlled by flags.

Definition at line 399 of file qtparsetimezone.cpp.

Variable Documentation

◆ AllLegacyForm

QtTemporalPattern::TemporalFieldFlags QtParseTimeZone::AllLegacyForm
constexpr

◆ AnyGlobalZoneForm

QtTemporalPattern::TemporalFieldFlags QtParseTimeZone::AnyGlobalZoneForm
constexpr
Initial value:
{
constexpr QtTemporalPattern::TemporalFieldFlags AnyOffsetForm
constexpr QtTemporalPattern::TemporalFieldFlags AnyGlobalZoneName

Definition at line 57 of file qtparsetimezone_p.h.

◆ AnyGlobalZoneName

QtTemporalPattern::TemporalFieldFlags QtParseTimeZone::AnyGlobalZoneName
constexpr

◆ AnyOffsetForm

QtTemporalPattern::TemporalFieldFlags QtParseTimeZone::AnyOffsetForm
constexpr

◆ AnyZoneForm

QtTemporalPattern::TemporalFieldFlags QtParseTimeZone::AnyZoneForm
constexpr

◆ AnyZoneName

QtTemporalPattern::TemporalFieldFlags QtParseTimeZone::AnyZoneName
constexpr

◆ BasicColonDigitOffset

◆ BasicDigitOnlyOffset

QtTemporalPattern::TemporalFieldFlags QtParseTimeZone::BasicDigitOnlyOffset
constexpr