- java.time 包类
- java.time - Home
- java.time - Clock
- java.time - Duration
- java.time - Instant
- java.time - LocalDate
- java.time - LocalDateTime
- java.time - LocalTime
- java.time - MonthDay
- java.time - OffsetDateTime
- java.time - OffsetTime
- java.time - Period
- java.time - Year
- java.time - YearMonth
- java.time - ZonedDateTime
- java.time - ZoneId
- java.time - ZoneOffset
- java.time 包枚举
- java.time - Month
- java.time 实用资源
- java.time - 讨论
java.time.ZoneId.getId() 方法示例
说明
java.time.ZoneId.getId() 方法获取唯一的时区 ID。
声明
以下是 java.time.ZoneId.getId() 方法的声明。
public abstract String getId()
返回值
唯一的时区 ID,非空
示例
以下示例演示了 java.time.ZoneId.getId() 方法的用法。
package com.tutorialspoint;
import java.time.ZoneId;
public class ZoneIdDemo {
public static void main(String[] args) {
ZoneId zoneId = ZoneId.of("Z");
System.out.println(zoneId.getId());
}
}
让我们编译并运行上述程序,这将生成以下结果 −
Z
广告