📜  java.time.ZoneId类

📅  最后修改于: 2020-11-14 10:49:17             🧑  作者: Mango


介绍

java.time.ZoneId类表示时区ID,例如Europe / Paris。

类声明

以下是java.time.ZoneId类的声明-

public abstract class ZoneId
   extends Object
      implements Serializable

领域

以下是Java.time.ZoneId类的字段-

  • 静态Map SHORT_IDS-区域覆盖的映射,以启用短时区名称。

类方法

Sr.No. Method & Description
1 boolean equals(Object obj)

Checks if this time-zone ID is equal to another time-zone ID.

2 static ZoneId from(TemporalAccessor temporal)

Obtains an instance of ZoneId from a temporal object.

3 static Set getAvailableZoneIds()

Gets the set of available zone IDs.

4 String getDisplayName(TextStyle style, Locale locale)

Gets the textual representation of the zone, such as ‘British Time’ or ‘+02:00’.

5 abstract String getId()

Gets the unique time-zone ID.

6 abstract ZoneRules getRules()

Gets the time-zone rules for this ID allowing calculations to be performed.

7 int hashCode()

A hash code for this time-zone ID.

8 ZoneId normalized()

Normalizes the time-zone ID, returning a ZoneOffset where possible.

9 static ZoneId of(String zoneId)

Obtains an instance of ZoneId from an ID ensuring that the ID is valid and available for use.

10 static ZoneId of(String zoneId, Map aliasMap)

Obtains an instance of ZoneId using its ID using a map of aliases to supplement the standard zone IDs.

11 static ZoneId ofOffset(String prefix, ZoneOffset offset)

Obtains an instance of ZoneId wrapping an offset.

12 static ZoneId systemDefault()

Gets the system default time-zone.

13 String toString()

Outputs this zone as a String, using the ID.

方法继承

此类从以下类继承方法-

  • Java.lang.Object