harmony 鸿蒙Time Zone Name Localization

  • 2025-06-12
  • 浏览 (4)

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.

  1. Import the i18n module.

    import { i18n } from '@kit.LocalizationKit';
    
  2. 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 鸿蒙Localization Kit

harmony 鸿蒙Calendar Setting

harmony 鸿蒙Character Processing

harmony 鸿蒙Overview

harmony 鸿蒙DST Transition

harmony 鸿蒙Overview of Internationalization and Localization

harmony 鸿蒙Language and Locale Name Localization

harmony 鸿蒙Locale ID and Cultural Habit Division

harmony 鸿蒙Number and Unit of Measurement Formatting

harmony 鸿蒙Phone Number Formatting

0  赞