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 1ab0f3ee0be051fe56bb233261285db7f0c3b5ea..0672bb3822799e4fc4db73bfbfbc96e918f29672 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-i18n.md +++ b/zh-cn/application-dev/reference/apis/js-apis-i18n.md @@ -1737,6 +1737,35 @@ static getTimezoneFromCity(cityID: string): TimeZone let timezone = I18n.TimeZone.getTimezoneFromCity("Shanghai"); ``` +### getTimezonesByLocation10+ + +static getTimezonesByLocation(longitude: number, latitude: number): Array<TimeZone> + +创建某经纬度对应的时区对象数组。 + +**系统能力**:SystemCapability.Global.I18n + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| --------- | ------ | ---- | ------ | +| longitude | number | 是 | 经度, 范围[-180, 179.9),东经取正值,西经取负值 | +| latitude | number | 是 | 纬度, 范围[-90, 89.9),北纬取正值,南纬取负值 | + +**返回值:** + +| 类型 | 说明 | +| -------- | ----------- | +| TimeZone | 时区城市对应的时区对象 | + +**示例:** + ```ts + let timezoneArray = I18n.TimeZone.getTimezonesByLocation(-118.1, 34.0); + for (var i = 0; i < timezoneArray.length; i++) { + let tzId = timezoneArray[i].getID(); + } + ``` + ## Transliterator9+