diff --git a/zh-cn/application-dev/reference/apis/js-apis-i18n.md b/zh-cn/application-dev/reference/apis/js-apis-i18n.md index edfb18333912c6d5c60dca8f989d131edce5b9a7..99788574b2994efa1c73fc60b0d890b46f4ee370 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-i18n.md +++ b/zh-cn/application-dev/reference/apis/js-apis-i18n.md @@ -2320,6 +2320,34 @@ getRegionInfoArray(regions: Array<string>, options?: SortOptions): Array&l } ``` +### getTimeZoneCityItemArray10+ + +static getTimeZoneCityItemArray(): Array<TimeZoneCityItem> + +获取时区城市组合信息的数组。 + +**系统接口**:此接口为系统接口。 + +**系统能力**:SystemCapability.Global.I18n + +**返回值:** + +| 类型 | 说明 | +| ----------------- | -------------------- | +| Array<[TimeZoneCityItem](#timezonecityitem10)> | 排序后的时区城市组合信息的数组。 | + +**示例:** + ```js + try { + let timeZoneCityItemArray = I18n.SystemLocaleManager.getTimeZoneCityItemArray(); + for (var i = 0; i < timeZoneCityItemArray.length; i++) { + console.log(timeZoneCityItemArray[i].zoneId + ", " + timeZoneCityItemArray[i].cityId + ", " + timeZoneCityItemArray[i].cityDisplayName + + ", " + timeZoneCityItemArray[i].offset + "\r\n"); + } + } catch(error) { + console.error(`call SystemLocaleManager.getTimeZoneCityItemArray failed, error code: ${error.code}, message: ${error.message}.`); + } + ``` ## LocaleItem10+ @@ -2334,6 +2362,21 @@ SystemLocaleManager对语言或国家地区列表的排序结果信息项。 | displayName | string | 是 | id在SystemLocaleManager的Locale下的表示。| | localName | string | 否 | id的本地名称。 | +## TimeZoneCityItem10+ + +封装时区城市组合信息的类型。 + +**系统能力**:SystemCapability.Global.I18n + +| 名称 | 类型 | 必填 | 说明 | +| --------------- | --------------- | ------ | --------------------------------------- | +| zoneId | string | 是 | 时区Id,例如Asia/Shanghai。 | +| cityId | string | 是 | 城市Id,例如Shanghai。 | +| cityDisplayName | string | 是 | 城市Id在系统Locale下显示的名称。 | +| offset | int | 是 | 时区Id的偏移量。 | +| zoneDisplayName | string | 是 | 时区Id在系统Locale下显示的名称。 | +| rawOffset | int | 否 | 时区Id的行偏移量。 | + ## SuggestionType10+