Movatterモバイル変換


[0]ホーム

URL:


ICU 78.1  78.1
Public Member Functions |Static Public Member Functions |Protected Member Functions
icu::TimeZoneFormat Class Reference

TimeZoneFormat supports time zone display name formatting and parsing.More...

#include <tzfmt.h>

Inheritance diagram for icu::TimeZoneFormat:

Public Member Functions

U_I18N_API TimeZoneFormat (constTimeZoneFormat &other)
 Copy constructor.More...
 
virtualU_I18N_API ~TimeZoneFormat ()
 Destructor.More...
 
U_I18N_APITimeZoneFormatoperator= (constTimeZoneFormat &other)
 Assignment operator.More...
 
virtualU_I18N_API bool operator== (constFormat &other) const override
 Return true if the givenFormat objects are semantically equal.More...
 
virtualU_I18N_APITimeZoneFormatclone () const override
 Clone this object polymorphically.More...
 
U_I18N_API constTimeZoneNamesgetTimeZoneNames () const
 Returns the time zone display name data used by this instance.More...
 
U_I18N_API void adoptTimeZoneNames (TimeZoneNames *tznames)
 Sets the time zone display name data to this format instance.More...
 
U_I18N_API void setTimeZoneNames (constTimeZoneNames &tznames)
 Sets the time zone display name data to this format instance.More...
 
U_I18N_APIUnicodeStringgetGMTPattern (UnicodeString &pattern) const
 Returns the localized GMT format pattern.More...
 
U_I18N_API void setGMTPattern (constUnicodeString &pattern,UErrorCode &status)
 Sets the localized GMT format pattern.More...
 
U_I18N_APIUnicodeStringgetGMTOffsetPattern (UTimeZoneFormatGMTOffsetPatternType type,UnicodeString &pattern) const
 Returns the offset pattern used for localized GMT format.More...
 
U_I18N_API void setGMTOffsetPattern (UTimeZoneFormatGMTOffsetPatternType type, constUnicodeString &pattern,UErrorCode &status)
 Sets the offset pattern for the given offset type.More...
 
U_I18N_APIUnicodeStringgetGMTOffsetDigits (UnicodeString &digits) const
 Returns the decimal digit characters used for localized GMT format.More...
 
U_I18N_API void setGMTOffsetDigits (constUnicodeString &digits,UErrorCode &status)
 Sets the decimal digit characters used for localized GMT format.More...
 
U_I18N_APIUnicodeStringgetGMTZeroFormat (UnicodeString &gmtZeroFormat) const
 Returns the localized GMT format string for GMT(UTC) itself (GMT offset is 0).More...
 
U_I18N_API void setGMTZeroFormat (constUnicodeString &gmtZeroFormat,UErrorCode &status)
 Sets the localized GMT format string for GMT(UTC) itself (GMT offset is 0).More...
 
U_I18N_API uint32_t getDefaultParseOptions () const
 Returns the bitwise flags of UTimeZoneFormatParseOption representing the default parse options used by this object.More...
 
U_I18N_API void setDefaultParseOptions (uint32_t flags)
 Sets the default parse options.More...
 
U_I18N_APIUnicodeStringformatOffsetISO8601Basic (int32_t offset,UBool useUtcIndicator,UBool isShort,UBool ignoreSeconds,UnicodeString &result,UErrorCode &status) const
 Returns the ISO 8601 basic time zone string for the given offset.More...
 
U_I18N_APIUnicodeStringformatOffsetISO8601Extended (int32_t offset,UBool useUtcIndicator,UBool isShort,UBool ignoreSeconds,UnicodeString &result,UErrorCode &status) const
 Returns the ISO 8601 extended time zone string for the given offset.More...
 
U_I18N_APIUnicodeStringformatOffsetLocalizedGMT (int32_t offset,UnicodeString &result,UErrorCode &status) const
 Returns the localized GMT(UTC) offset format for the given offset.More...
 
U_I18N_APIUnicodeStringformatOffsetShortLocalizedGMT (int32_t offset,UnicodeString &result,UErrorCode &status) const
 Returns the short localized GMT(UTC) offset format for the given offset.More...
 
virtualU_I18N_APIUnicodeStringformat (UTimeZoneFormatStyle style, constTimeZone &tz,UDate date,UnicodeString &name,UTimeZoneFormatTimeType *timeType=nullptr) const
 Returns the display name of the time zone at the given date for the style.More...
 
U_I18N_API int32_t parseOffsetISO8601 (constUnicodeString &text,ParsePosition &pos) const
 Returns offset from GMT(UTC) in milliseconds for the given ISO 8601 style time zone string.More...
 
U_I18N_API int32_t parseOffsetLocalizedGMT (constUnicodeString &text,ParsePosition &pos) const
 Returns offset from GMT(UTC) in milliseconds for the given localized GMT offset format string.More...
 
U_I18N_API int32_t parseOffsetShortLocalizedGMT (constUnicodeString &text,ParsePosition &pos) const
 Returns offset from GMT(UTC) in milliseconds for the given short localized GMT offset format string.More...
 
virtualU_I18N_APITimeZoneparse (UTimeZoneFormatStyle style, constUnicodeString &text,ParsePosition &pos, int32_t parseOptions,UTimeZoneFormatTimeType *timeType=nullptr) const
 Returns aTimeZone by parsing the time zone string according to the given parse position, the specified format style and parse options.More...
 
U_I18N_APITimeZoneparse (UTimeZoneFormatStyle style, constUnicodeString &text,ParsePosition &pos,UTimeZoneFormatTimeType *timeType=nullptr) const
 Returns aTimeZone by parsing the time zone string according to the given parse position, the specified format style and the default parse options.More...
 
virtualU_I18N_APIUnicodeStringformat (constFormattable &obj,UnicodeString &appendTo,FieldPosition &pos,UErrorCode &status) const override
 Format an object to produce a time zone display string using localized GMT offset format.More...
 
virtualU_I18N_API void parseObject (constUnicodeString &source,Formattable &result,ParsePosition &parse_pos) const override
 Parse a string to produce an object.More...
 
virtualU_I18N_APIUClassID getDynamicClassID () const override
 ICU "poor man's RTTI", returns a UClassID for the actual class.More...
 
U_I18N_APIUnicodeStringformat (constFormattable &obj,UnicodeString &appendTo,UErrorCode &status) const
 Formats an object to produce a string.More...
 
virtualU_I18N_APIUnicodeStringformat (constFormattable &obj,UnicodeString &appendTo,FieldPosition &pos,UErrorCode &status) const=0
 Format an object to produce a string.More...
 
virtualU_I18N_APIUnicodeStringformat (constFormattable &obj,UnicodeString &appendTo,FieldPositionIterator *posIter,UErrorCode &status) const
 Format an object to produce a string.More...
 
- Public Member Functions inherited fromicu::Format
virtualU_I18N_API ~Format ()
 Destructor.More...
 
U_I18N_API bool operator!= (constFormat &other) const
 Return true if the givenFormat objects are not semantically equal.More...
 
U_I18N_APIUnicodeStringformat (constFormattable &obj,UnicodeString &appendTo,UErrorCode &status) const
 Formats an object to produce a string.More...
 
virtualU_I18N_APIUnicodeStringformat (constFormattable &obj,UnicodeString &appendTo,FieldPositionIterator *posIter,UErrorCode &status) const
 Format an object to produce a string.More...
 
U_I18N_API void parseObject (constUnicodeString &source,Formattable &result,UErrorCode &status) const
 Parses a string to produce an object.More...
 
U_I18N_APILocale getLocale (ULocDataLocaleType type,UErrorCode &status) const
 Get the locale for this format object.More...
 
U_I18N_API const char * getLocaleID (ULocDataLocaleType type,UErrorCode &status) const
 Get the locale for this format object.More...
 
- Public Member Functions inherited fromicu::UObject
virtual ~UObject ()
 Destructor.More...
 

Static Public Member Functions

staticU_I18N_APITimeZoneFormatcreateInstance (constLocale &locale,UErrorCode &status)
 Creates an instance ofTimeZoneFormat for the given locale.More...
 
staticU_I18N_APIUClassID getStaticClassID ()
 ICU "poor man's RTTI", returns a UClassID for this class.More...
 

Protected Member Functions

U_I18N_API TimeZoneFormat (constLocale &locale,UErrorCode &status)
 Constructs aTimeZoneFormat object for the specified locale.More...
 
- Protected Member Functions inherited fromicu::Format
U_I18N_API void setLocaleIDs (const char *valid, const char *actual)
 
U_I18N_API Format ()
 Default constructor for subclass use only.More...
 
U_I18N_API Format (constFormat &)
 
U_I18N_APIFormatoperator= (constFormat &)
 

Additional Inherited Members

- Static Protected Member Functions inherited fromicu::Format
staticU_I18N_API void syntaxError (constUnicodeString &pattern, int32_t pos,UParseError &parseError)
 Simple function for initializing aUParseError from aUnicodeString.More...
 

Detailed Description

TimeZoneFormat supports time zone display name formatting and parsing.

An instance ofTimeZoneFormat works as a subformatter ofSimpleDateFormat, but you can also directly get a new instance ofTimeZoneFormat and formatting/parsing time zone display names.

ICU implements the time zone display names defined byUTS#35 Unicode Locale Data Markup Language (LDML).TimeZoneNames represents the time zone display name data model and this class implements the algorithm for actual formatting and parsing.

See also
SimpleDateFormat
TimeZoneNames
Stable:
ICU 50

Definition at line274 of filetzfmt.h.

Constructor & Destructor Documentation

◆ TimeZoneFormat()[1/2]

U_I18N_API icu::TimeZoneFormat::TimeZoneFormat(constTimeZoneFormatother)

Copy constructor.

Stable:
ICU 50

◆ ~TimeZoneFormat()

virtualU_I18N_API icu::TimeZoneFormat::~TimeZoneFormat()
virtual

Destructor.

Stable:
ICU 50

◆ TimeZoneFormat()[2/2]

U_I18N_API icu::TimeZoneFormat::TimeZoneFormat(constLocalelocale,
UErrorCodestatus 
)
protected

Constructs aTimeZoneFormat object for the specified locale.

Parameters
localethe locale
statusreceives the status.
Stable:
ICU 50

Member Function Documentation

◆ adoptTimeZoneNames()

U_I18N_API void icu::TimeZoneFormat::adoptTimeZoneNames(TimeZoneNamestznames)

Sets the time zone display name data to this format instance.

The caller should not delete the TimeZoenNames object after it is adopted by this call.

Parameters
tznamesTimeZoneNames object to be adopted.
Stable:
ICU 50

◆ clone()

virtualU_I18N_APITimeZoneFormat* icu::TimeZoneFormat::clone() const
overridevirtual

Clone this object polymorphically.

The caller is responsible for deleting the result when done.

Returns
A copy of the object
Stable:
ICU 50

Implementsicu::Format.

◆ createInstance()

staticU_I18N_APITimeZoneFormat* icu::TimeZoneFormat::createInstance(constLocalelocale,
UErrorCodestatus 
)
static

Creates an instance ofTimeZoneFormat for the given locale.

Parameters
localeThe locale.
statusReceives the status.
Returns
An instance ofTimeZoneFormat for the given locale, owned by the caller.
Stable:
ICU 50

◆ format()[1/5]

virtualU_I18N_APIUnicodeString& icu::TimeZoneFormat::format(constFormattableobj,
UnicodeStringappendTo,
FieldPositionpos,
UErrorCodestatus 
) const
overridevirtual

Format an object to produce a time zone display string using localized GMT offset format.

This method handlesFormattable objects with aTimeZone. If a theFormattable object type is not aTimeZone, then it returns a failing UErrorCode.

Parameters
objThe object to format. Must be aTimeZone.
appendToOutput parameter to receive result. Result is appended to existing contents.
posOn input: an alignment field, if desired. On output: the offsets of the alignment field.
statusOutput param filled with success/failure status.
Returns
Reference to 'appendTo' parameter.
Stable:
ICU 50

Implementsicu::Format.

◆ format()[2/5]

virtualU_I18N_APIUnicodeString& icu::Format::format

Format an object to produce a string.

This is a pure virtual method which subclasses must implement. This method allows polymorphic formatting ofFormattable objects. If a subclass ofFormat receives aFormattable object type it doesn't handle (e.g., if a numericFormattable is passed to aDateFormat object) then it returns a failing UErrorCode.

Parameters
objThe object to format.
appendToOutput parameter to receive result. Result is appended to existing contents.
posOn input: an alignment field, if desired. On output: the offsets of the alignment field.
statusOutput param filled with success/failure status.
Returns
Reference to 'appendTo' parameter.
Stable:
ICU 2.0

◆ format()[3/5]

virtualU_I18N_APIUnicodeString& icu::Format::format

Format an object to produce a string.

Subclasses should override this method. This method allows polymorphic formatting ofFormattable objects. If a subclass ofFormat receives aFormattable object type it doesn't handle (e.g., if a numericFormattable is passed to aDateFormat object) then it returns a failing UErrorCode.

Parameters
objThe object to format.
appendToOutput parameter to receive result. Result is appended to existing contents.
posIterOn return, can be used to iterate over positions of fields generated by this format call.
statusOutput param filled with success/failure status.
Returns
Reference to 'appendTo' parameter.
Stable:
ICU 4.4

◆ format()[4/5]

U_I18N_APIUnicodeString& icu::Format::format

Formats an object to produce a string.

Parameters
objThe object to format.
appendToOutput parameter to receive result. Result is appended to existing contents.
statusOutput parameter filled in with success or failure status.
Returns
Reference to 'appendTo' parameter.
Stable:
ICU 2.0

◆ format()[5/5]

virtualU_I18N_APIUnicodeString& icu::TimeZoneFormat::format(UTimeZoneFormatStyle style,
constTimeZonetz,
UDate date,
UnicodeStringname,
UTimeZoneFormatTimeTypetimeType =nullptr 
) const
virtual

Returns the display name of the time zone at the given date for the style.

Parameters
styleThe style (e.g.UTZFMT_STYLE_GENERIC_LONG,UTZFMT_STYLE_LOCALIZED_GMT...)
tzThe time zone.
dateThe date.
nameReceives the display name.
timeTypethe output argument for receiving the time type (standard/daylight/unknown) used for the display name, or nullptr if the information is not necessary.
Returns
A reference to the result
See also
UTimeZoneFormatStyle
UTimeZoneFormatTimeType
Stable:
ICU 50

◆ formatOffsetISO8601Basic()

U_I18N_APIUnicodeString& icu::TimeZoneFormat::formatOffsetISO8601Basic(int32_t offset,
UBool useUtcIndicator,
UBool isShort,
UBool ignoreSeconds,
UnicodeStringresult,
UErrorCodestatus 
) const

Returns the ISO 8601 basic time zone string for the given offset.

For example, "-08", "-0830" and "Z"

Parameters
offsetthe offset from GMT(UTC) in milliseconds.
useUtcIndicatortrue if ISO 8601 UTC indicator "Z" is used when the offset is 0.
isShorttrue if shortest form is used.
ignoreSecondstrue if non-zero offset seconds is appended.
resultReceives the ISO format string.
statusReceives the status
Returns
the ISO 8601 basic format.
See also
formatOffsetISO8601Extended
parseOffsetISO8601
Stable:
ICU 51

◆ formatOffsetISO8601Extended()

U_I18N_APIUnicodeString& icu::TimeZoneFormat::formatOffsetISO8601Extended(int32_t offset,
UBool useUtcIndicator,
UBool isShort,
UBool ignoreSeconds,
UnicodeStringresult,
UErrorCodestatus 
) const

Returns the ISO 8601 extended time zone string for the given offset.

For example, "-08:00", "-08:30" and "Z"

Parameters
offsetthe offset from GMT(UTC) in milliseconds.
useUtcIndicatortrue if ISO 8601 UTC indicator "Z" is used when the offset is 0.
isShorttrue if shortest form is used.
ignoreSecondstrue if non-zero offset seconds is appended.
resultReceives the ISO format string.
statusReceives the status
Returns
the ISO 8601 basic format.
See also
formatOffsetISO8601Extended
parseOffsetISO8601
Stable:
ICU 51

◆ formatOffsetLocalizedGMT()

U_I18N_APIUnicodeString& icu::TimeZoneFormat::formatOffsetLocalizedGMT(int32_t offset,
UnicodeStringresult,
UErrorCodestatus 
) const

Returns the localized GMT(UTC) offset format for the given offset.

The localized GMT offset is defined by;

This format always uses 2 digit hours and minutes. When the given offset has non-zero seconds, 2 digit seconds field will be appended. For example, GMT+05:00 and GMT+05:28:06.

Parameters
offsetthe offset from GMT(UTC) in milliseconds.
statusReceives the status
resultReceives the localized GMT format string.
Returns
A reference to the result.
See also
parseOffsetLocalizedGMT
Stable:
ICU 50

◆ formatOffsetShortLocalizedGMT()

U_I18N_APIUnicodeString& icu::TimeZoneFormat::formatOffsetShortLocalizedGMT(int32_t offset,
UnicodeStringresult,
UErrorCodestatus 
) const

Returns the short localized GMT(UTC) offset format for the given offset.

The short localized GMT offset is defined by;

This format uses the shortest representation of offset. The hours field does not have leading zero and lower fields with zero will be truncated. For example, GMT+5 and GMT+530.

Parameters
offsetthe offset from GMT(UTC) in milliseconds.
statusReceives the status
resultReceives the short localized GMT format string.
Returns
A reference to the result.
See also
parseOffsetShortLocalizedGMT
Stable:
ICU 51

◆ getDefaultParseOptions()

U_I18N_API uint32_t icu::TimeZoneFormat::getDefaultParseOptions() const

Returns the bitwise flags of UTimeZoneFormatParseOption representing the default parse options used by this object.

Returns
the default parse options.
See also
ParseOption
Stable:
ICU 50

◆ getDynamicClassID()

virtualU_I18N_APIUClassID icu::TimeZoneFormat::getDynamicClassID() const
overridevirtual

ICU "poor man's RTTI", returns a UClassID for the actual class.

Stable:
ICU 50

Reimplemented fromicu::UObject.

◆ getGMTOffsetDigits()

U_I18N_APIUnicodeString& icu::TimeZoneFormat::getGMTOffsetDigits(UnicodeStringdigits) const

Returns the decimal digit characters used for localized GMT format.

The return string contains exactly 10 code points (may include Unicode supplementary character) representing digit 0 to digit 9 in the ascending order.

Parameters
digitsReceives the decimal digits used for localized GMT format.
See also
setGMTOffsetDigits
Stable:
ICU 50

◆ getGMTOffsetPattern()

U_I18N_APIUnicodeString& icu::TimeZoneFormat::getGMTOffsetPattern(UTimeZoneFormatGMTOffsetPatternType type,
UnicodeStringpattern 
) const

Returns the offset pattern used for localized GMT format.

Parameters
typeThe offset pattern type enum.
patternReceives the offset pattern.
Returns
A reference to the result pattern.
See also
setGMTOffsetPattern
Stable:
ICU 50

◆ getGMTPattern()

U_I18N_APIUnicodeString& icu::TimeZoneFormat::getGMTPattern(UnicodeStringpattern) const

Returns the localized GMT format pattern.

Parameters
patternReceives the localized GMT format pattern.
Returns
A reference to the result pattern.
See also
setGMTPattern
Stable:
ICU 50

◆ getGMTZeroFormat()

U_I18N_APIUnicodeString& icu::TimeZoneFormat::getGMTZeroFormat(UnicodeStringgmtZeroFormat) const

Returns the localized GMT format string for GMT(UTC) itself (GMT offset is 0).

Parameters
gmtZeroFormatReceives the localized GMT string string for GMT(UTC) itself.
Returns
A reference to the result GMT string.
See also
setGMTZeroFormat
Stable:
ICU 50

◆ getStaticClassID()

staticU_I18N_APIUClassID icu::TimeZoneFormat::getStaticClassID()
static

ICU "poor man's RTTI", returns a UClassID for this class.

Stable:
ICU 50

◆ getTimeZoneNames()

U_I18N_API constTimeZoneNames* icu::TimeZoneFormat::getTimeZoneNames() const

Returns the time zone display name data used by this instance.

Returns
The time zone display name data.
Stable:
ICU 50

◆ operator=()

U_I18N_APITimeZoneFormat& icu::TimeZoneFormat::operator=(constTimeZoneFormatother)

Assignment operator.

Stable:
ICU 50

◆ operator==()

virtualU_I18N_API bool icu::TimeZoneFormat::operator==(constFormatother) const
overridevirtual

Return true if the givenFormat objects are semantically equal.

Objects of different subclasses are considered unequal.

Parameters
otherThe object to be compared with.
Returns
Return true if the givenFormat objects are semantically equal. Objects of different subclasses are considered unequal.
Stable:
ICU 50

Implementsicu::Format.

◆ parse()[1/2]

virtualU_I18N_APITimeZone* icu::TimeZoneFormat::parse(UTimeZoneFormatStyle style,
constUnicodeStringtext,
ParsePositionpos,
int32_t parseOptions,
UTimeZoneFormatTimeTypetimeType =nullptr 
) const
virtual

Returns aTimeZone by parsing the time zone string according to the given parse position, the specified format style and parse options.

Parameters
textThe text contains a time zone string at the position.
styleThe format style
posThe position.
parseOptionsThe parse options represented by bitwise flags of UTimeZoneFormatParseOption.
timeTypeThe output argument for receiving the time type (standard/daylight/unknown), or nullptr if the information is not necessary.
Returns
ATimeZone, or null if the input could not be parsed.
See also
UTimeZoneFormatStyle
UTimeZoneFormatParseOption
UTimeZoneFormatTimeType
Stable:
ICU 50

◆ parse()[2/2]

U_I18N_APITimeZone* icu::TimeZoneFormat::parse(UTimeZoneFormatStyle style,
constUnicodeStringtext,
ParsePositionpos,
UTimeZoneFormatTimeTypetimeType =nullptr 
) const

Returns aTimeZone by parsing the time zone string according to the given parse position, the specified format style and the default parse options.

Parameters
textThe text contains a time zone string at the position.
styleThe format style
posThe position.
timeTypeThe output argument for receiving the time type (standard/daylight/unknown), or nullptr if the information is not necessary.
Returns
ATimeZone, or null if the input could not be parsed.
See also
UTimeZoneFormatStyle
UTimeZoneFormatParseOption
UTimeZoneFormatTimeType
Stable:
ICU 50

◆ parseObject()

virtualU_I18N_API void icu::TimeZoneFormat::parseObject(constUnicodeStringsource,
Formattableresult,
ParsePositionparse_pos 
) const
overridevirtual

Parse a string to produce an object.

This methods handles parsing of time zone display strings intoFormattable objects withTimeZone.

Parameters
sourceThe string to be parsed into an object.
resultFormattable to be set to the parse result. If parse fails, return contents are undefined.
parse_posThe position to start parsing at. Upon return this param is set to the position after the last character successfully parsed. If the source is not parsed successfully, this param will remain unchanged.
Returns
A newly created Formattable* object, or nullptr on failure. The caller owns this and should delete it when done.
Stable:
ICU 50

Implementsicu::Format.

◆ parseOffsetISO8601()

U_I18N_API int32_t icu::TimeZoneFormat::parseOffsetISO8601(constUnicodeStringtext,
ParsePositionpos 
) const

Returns offset from GMT(UTC) in milliseconds for the given ISO 8601 style time zone string.

When the given string is not an ISO 8601 time zone string, this method sets the current position as the error index toParsePosition pos and returns 0.

Parameters
textThe text contains ISO8601 style time zone string (e.g. "-08:00", "Z") at the position.
posTheParsePosition object.
Returns
The offset from GMT(UTC) in milliseconds for the given ISO 8601 style time zone string.
See also
formatOffsetISO8601Basic
formatOffsetISO8601Extended
Stable:
ICU 50

◆ parseOffsetLocalizedGMT()

U_I18N_API int32_t icu::TimeZoneFormat::parseOffsetLocalizedGMT(constUnicodeStringtext,
ParsePositionpos 
) const

Returns offset from GMT(UTC) in milliseconds for the given localized GMT offset format string.

When the given string cannot be parsed, this method sets the current position as the error index toParsePosition pos and returns 0.

Parameters
textThe text contains a localized GMT offset string at the position.
posTheParsePosition object.
Returns
The offset from GMT(UTC) in milliseconds for the given localized GMT offset format string.
See also
formatOffsetLocalizedGMT
Stable:
ICU 50

◆ parseOffsetShortLocalizedGMT()

U_I18N_API int32_t icu::TimeZoneFormat::parseOffsetShortLocalizedGMT(constUnicodeStringtext,
ParsePositionpos 
) const

Returns offset from GMT(UTC) in milliseconds for the given short localized GMT offset format string.

When the given string cannot be parsed, this method sets the current position as the error index toParsePosition pos and returns 0.

Parameters
textThe text contains a short localized GMT offset string at the position.
posTheParsePosition object.
Returns
The offset from GMT(UTC) in milliseconds for the given short localized GMT offset format string.
See also
formatOffsetShortLocalizedGMT
Stable:
ICU 51

◆ setDefaultParseOptions()

U_I18N_API void icu::TimeZoneFormat::setDefaultParseOptions(uint32_t flags)

Sets the default parse options.

Note: By default, an instance ofTimeZoneFormat created bycreateInstance has no parse options set (UTZFMT_PARSE_OPTION_NONE). To specify multiple options, use bitwise flags of UTimeZoneFormatParseOption.

See also
UTimeZoneFormatParseOption
Stable:
ICU 50

◆ setGMTOffsetDigits()

U_I18N_API void icu::TimeZoneFormat::setGMTOffsetDigits(constUnicodeStringdigits,
UErrorCodestatus 
)

Sets the decimal digit characters used for localized GMT format.

The inputdigits must contain exactly 10 code points (Unicode supplementary characters are also allowed) representing digit 0 to digit 9 in the ascending order. When the inputdigits does not satisfy the condition,U_ILLEGAL_ARGUMENT_ERROR will be set to the return status.

Parameters
digitsThe decimal digits used for localized GMT format.
statusReceives the status.
See also
getGMTOffsetDigits
Stable:
ICU 50

◆ setGMTOffsetPattern()

U_I18N_API void icu::TimeZoneFormat::setGMTOffsetPattern(UTimeZoneFormatGMTOffsetPatternType type,
constUnicodeStringpattern,
UErrorCodestatus 
)

Sets the offset pattern for the given offset type.

Parameters
typeThe offset pattern type enum.
patternThe offset pattern used for localized GMT format for the type.
statusReceives the status.
See also
getGMTOffsetPattern
Stable:
ICU 50

◆ setGMTPattern()

U_I18N_API void icu::TimeZoneFormat::setGMTPattern(constUnicodeStringpattern,
UErrorCodestatus 
)

Sets the localized GMT format pattern.

The pattern must contain a single argument {0}, for example "GMT {0}".

Parameters
patternThe localized GMT format pattern to be used by this object.
statusReceives the status.
See also
getGMTPattern
Stable:
ICU 50

◆ setGMTZeroFormat()

U_I18N_API void icu::TimeZoneFormat::setGMTZeroFormat(constUnicodeStringgmtZeroFormat,
UErrorCodestatus 
)

Sets the localized GMT format string for GMT(UTC) itself (GMT offset is 0).

Parameters
gmtZeroFormatThe localized GMT format string for GMT(UTC).
statusReceives the status.
See also
getGMTZeroFormat
Stable:
ICU 50

◆ setTimeZoneNames()

U_I18N_API void icu::TimeZoneFormat::setTimeZoneNames(constTimeZoneNamestznames)

Sets the time zone display name data to this format instance.

Parameters
tznamesTimeZoneNames object to be set.
Stable:
ICU 50

The documentation for this class was generated from the following file:

Generated by doxygen 1.9.1
[8]ページ先頭

©2009-2025 Movatter.jp