harmony 鸿蒙Time Zone Name Localization
Time Zone Name Localization
Use Cases
In a multi-language environment, time zones may be addressed by users in different regions in different ways. To this end, your application needs to localize time zone names to adapt to local user habits.
How to Develop
For details about how to use related APIs, see getDisplayName.
Import the i18n module.
import { i18n } from '@kit.LocalizationKit';
Localize the time zone name, for example, America/Sao_Paulo.
let timezone: i18n.TimeZone = i18n.getTimeZone('America/Sao_Paulo'); let timeZoneName: string = timezone.getDisplayName ('zh-Hans', true); // timeZoneName ='Brasília Standard Time'
你可能感兴趣的鸿蒙文章
harmony 鸿蒙Character Processing
harmony 鸿蒙Overview of Internationalization and Localization
harmony 鸿蒙Language and Locale Name Localization
harmony 鸿蒙Locale ID and Cultural Habit Division
0
赞
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦