Freigeben über


TimeUtils.GetTimeZoneIdsForCountryCode(String) Method

Definition

Returns time zone IDs for time zones known to be associated with a country.

[Android.Runtime.Register("getTimeZoneIdsForCountryCode", "(Ljava/lang/String;)Ljava/util/List;", "", ApiSince=29)]
public static System.Collections.Generic.IList<string>? GetTimeZoneIdsForCountryCode (string countryCode);
[<Android.Runtime.Register("getTimeZoneIdsForCountryCode", "(Ljava/lang/String;)Ljava/util/List;", "", ApiSince=29)>]
static member GetTimeZoneIdsForCountryCode : string -> System.Collections.Generic.IList<string>

Parameters

countryCode
String

the ISO 3166-1 alpha-2 code for the country as can be obtained using java.util.Locale#getCountry()

Returns

IDs that can be passed to java.util.TimeZone#getTimeZone(String) or similar methods, or null if the countryCode is unrecognized

Attributes

Remarks

Returns time zone IDs for time zones known to be associated with a country.

The list returned may be different from other on-device sources like android.icu.util.TimeZone#getRegion(String) as it can be curated to avoid contentious or obsolete mappings.

Java documentation for android.util.TimeUtils.getTimeZoneIdsForCountryCode(java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to