软件包 | 描述 |
---|---|
java.time |
日期、时间、时刻主要的API,和持续时间。
|
java.time.chrono |
除了默认的标准以外的日历系统的通用的。
|
java.time.format |
提供打印和解析日期和时间的类。
|
java.time.temporal |
访问日期和时间的应用领域和单位,时间和日期的调节。
|
java.util |
包含集合框架、遗留的集合类、事件模型、日期和时间的设施、国际化和各种实用工具类(一个字符串标记,一个随机数发生器,和一位阵列)。
|
Modifier and Type | Class and Description |
---|---|
class |
ZoneOffset
一个时区偏移量从格林尼治/ UTC,如
+02:00 。
|
Modifier and Type | Method and Description |
---|---|
static ZoneId |
ZoneId.from(TemporalAccessor temporal)
获得
ZoneId 实例从一个时空对象。
|
abstract ZoneId |
Clock.getZone()
获取用于创建日期和时间的时区。
|
ZoneId |
ZonedDateTime.getZone()
获取时间区域,如“欧洲/巴黎”。
|
ZoneId |
ZoneId.normalized()
规范时区ID,返回一个
ZoneOffset 尽可能。
|
static ZoneId |
ZoneId.of(String zoneId)
获得
ZoneId 实例的ID确保身份的有效性和可供使用。
|
static ZoneId |
ZoneId.of(String zoneId, Map<String,String> aliasMap)
得到一个实例
ZoneId 使用ID使用Map的别名,以补充标准区ID。
|
static ZoneId |
ZoneId.ofOffset(String prefix, ZoneOffset offset)
获得
ZoneId 包装胶印的实例。
|
static ZoneId |
ZoneId.systemDefault()
获取系统默认时区。
|
Modifier and Type | Method and Description |
---|---|
ZonedDateTime |
LocalDate.atStartOfDay(ZoneId zone)
根据时区的规则,在最早的有效时间内返回一个分区的时间。
|
ZonedDateTime |
Instant.atZone(ZoneId zone)
结合即时时区创建
ZonedDateTime 。
|
ZonedDateTime |
LocalDateTime.atZone(ZoneId zone)
结合时间与时区来创建一个
ZonedDateTime 。
|
ZonedDateTime |
OffsetDateTime.atZoneSameInstant(ZoneId zone)
结合时间与时区来创建一个
ZonedDateTime 确保结果具有相同的瞬间。
|
ZonedDateTime |
OffsetDateTime.atZoneSimilarLocal(ZoneId zone)
结合时间与时区来创建一个
ZonedDateTime 一直保持相同的本地日期和时间。
|
static Clock |
Clock.fixed(Instant fixedInstant, ZoneId zone)
获得总是返回同一时刻的时钟。
|
static MonthDay |
MonthDay.now(ZoneId zone)
从指定时区中的系统时钟中获得当前的月日。
|
static OffsetTime |
OffsetTime.now(ZoneId zone)
从指定时区中的系统时钟中获得当前时间。
|
static OffsetDateTime |
OffsetDateTime.now(ZoneId zone)
从指定时区中的系统时钟中获得当前日期时间。
|
static LocalTime |
LocalTime.now(ZoneId zone)
从指定时区中的系统时钟中获得当前时间。
|
static LocalDate |
LocalDate.now(ZoneId zone)
从指定时区中的系统时钟中获取当前日期。
|
static YearMonth |
YearMonth.now(ZoneId zone)
从指定时区中的系统时钟中获得当前年月份。
|
static LocalDateTime |
LocalDateTime.now(ZoneId zone)
从指定时区中的系统时钟中获得当前日期时间。
|
static ZonedDateTime |
ZonedDateTime.now(ZoneId zone)
从指定时区中的系统时钟中获得当前日期时间。
|
static Year |
Year.now(ZoneId zone)
从指定时区中的系统时钟获取当前年份。
|
static ZonedDateTime |
ZonedDateTime.of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, ZoneId zone)
获得
ZonedDateTime 实例从年,月,日,小时,分钟,秒,纳秒和时区。
|
static ZonedDateTime |
ZonedDateTime.of(LocalDate date, LocalTime time, ZoneId zone)
获得
ZonedDateTime 实例从本地日期和时间。
|
static ZonedDateTime |
ZonedDateTime.of(LocalDateTime localDateTime, ZoneId zone)
获得
ZonedDateTime 实例从本地日期时间。
|
static OffsetTime |
OffsetTime.ofInstant(Instant instant, ZoneId zone)
获得
OffsetTime 实例从一个
Instant 和区域ID。
|
static OffsetDateTime |
OffsetDateTime.ofInstant(Instant instant, ZoneId zone)
获得
OffsetDateTime 实例从一个
Instant 和区域ID。
|
static LocalDateTime |
LocalDateTime.ofInstant(Instant instant, ZoneId zone)
获得
LocalDateTime 实例从一个
Instant 和区域ID。
|
static ZonedDateTime |
ZonedDateTime.ofInstant(Instant instant, ZoneId zone)
获得
ZonedDateTime 实例从一个
Instant 。
|
static ZonedDateTime |
ZonedDateTime.ofInstant(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone)
获得
ZonedDateTime 实例从结合当地的日期时间和偏移形成的瞬间。
|
static ZonedDateTime |
ZonedDateTime.ofLocal(LocalDateTime localDateTime, ZoneId zone, ZoneOffset preferredOffset)
获得
ZonedDateTime 实例从使用首选本地日期时间如果可能抵消。
|
static ZonedDateTime |
ZonedDateTime.ofStrict(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone)
获得
ZonedDateTime 严格验证本地日期时间结合的实例,偏移和区域ID。
|
static Clock |
Clock.system(ZoneId zone)
获得一个时钟,返回当前即时使用最佳可用的系统时钟。
|
static Clock |
Clock.tickMinutes(ZoneId zone)
获得一个时钟,返回当前即时在整个分钟内使用最好的可用的系统时钟。
|
static Clock |
Clock.tickSeconds(ZoneId zone)
获得一个时钟,返回当前的即时滴答在整个秒使用最好的系统时钟。
|
abstract Clock |
Clock.withZone(ZoneId zone)
返回这个时钟的副本与一个不同的时区。
|
ZonedDateTime |
ZonedDateTime.withZoneSameInstant(ZoneId zone)
返回此日期时间的副本,以不同的时区,保留即时。
|
ZonedDateTime |
ZonedDateTime.withZoneSameLocal(ZoneId zone)
返回此日期时间的副本,以不同的时区,如果可能的话,保留本地日期时间。
|
Modifier and Type | Method and Description |
---|---|
ZoneId |
ChronoZonedDateTime.getZone()
获取区域标识,如“欧洲/巴黎”。
|
Modifier and Type | Method and Description |
---|---|
ChronoZonedDateTime<D> |
ChronoLocalDateTime.atZone(ZoneId zone)
结合这一次的时间区创建
ChronoZonedDateTime 。
|
LocalDate |
IsoChronology.dateNow(ZoneId zone)
在指定的时区中从系统时钟中获得当前的本地日期。
|
default ChronoLocalDate |
Chronology.dateNow(ZoneId zone)
从指定时区中的系统时钟中获取当前本地日期。
|
ThaiBuddhistDate |
ThaiBuddhistChronology.dateNow(ZoneId zone) |
JapaneseDate |
JapaneseChronology.dateNow(ZoneId zone) |
MinguoDate |
MinguoChronology.dateNow(ZoneId zone) |
HijrahDate |
HijrahChronology.dateNow(ZoneId zone) |
static HijrahDate |
HijrahDate.now(ZoneId zone)
获得指定的时区的伊斯兰乌姆Qura日历的当前
HijrahDate 。
|
static MinguoDate |
MinguoDate.now(ZoneId zone)
获得当前
MinguoDate 从指定的时区系统时钟。
|
static JapaneseDate |
JapaneseDate.now(ZoneId zone)
获得当前
JapaneseDate 从指定的时区系统时钟。
|
static ThaiBuddhistDate |
ThaiBuddhistDate.now(ZoneId zone)
获得当前
ThaiBuddhistDate 从指定的时区系统时钟。
|
ChronoZonedDateTime<D> |
ChronoZonedDateTime.withZoneSameInstant(ZoneId zone)
返回此日期时间的副本,以不同的时区,保留即时。
|
ChronoZonedDateTime<D> |
ChronoZonedDateTime.withZoneSameLocal(ZoneId zone)
返回一份本ZonedDateTime与一个不同的时区,保留当地的日期时间如果可能的话。
|
ZonedDateTime |
IsoChronology.zonedDateTime(Instant instant, ZoneId zone)
获得ISO划从
Instant 本年表日期时间。
|
default ChronoZonedDateTime<? extends ChronoLocalDate> |
Chronology.zonedDateTime(Instant instant, ZoneId zone)
从一个
Instant 这一
ChronoZonedDateTime 年表。
|
ChronoZonedDateTime<ThaiBuddhistDate> |
ThaiBuddhistChronology.zonedDateTime(Instant instant, ZoneId zone) |
ChronoZonedDateTime<JapaneseDate> |
JapaneseChronology.zonedDateTime(Instant instant, ZoneId zone) |
ChronoZonedDateTime<MinguoDate> |
MinguoChronology.zonedDateTime(Instant instant, ZoneId zone) |
ChronoZonedDateTime<HijrahDate> |
HijrahChronology.zonedDateTime(Instant instant, ZoneId zone) |
Modifier and Type | Method and Description |
---|---|
ZoneId |
DateTimeFormatter.getZone()
获取在格式化过程中使用的最重要的区域。
|
Modifier and Type | Method and Description |
---|---|
DateTimeFormatter |
DateTimeFormatter.withZone(ZoneId zone)
返回一个格式化程序的一个新的覆盖区,这。
|
Modifier and Type | Method and Description |
---|---|
DateTimeFormatterBuilder |
DateTimeFormatterBuilder.appendZoneText(TextStyle textStyle, Set<ZoneId> preferredZones)
附加时区名称,如“英国夏令时间,到格式化程序。
|
Modifier and Type | Method and Description |
---|---|
static TemporalQuery<ZoneId> |
TemporalQueries.zone()
为
ZoneId 宽大的查询,落回
ZoneOffset 。
|
static TemporalQuery<ZoneId> |
TemporalQueries.zoneId()
为
ZoneId 严格查询。
|
Modifier and Type | Method and Description |
---|---|
ZoneId |
TimeZone.toZoneId()
将这一
ZoneId
TimeZone 对象。
|
Modifier and Type | Method and Description |
---|---|
static TimeZone |
TimeZone.getTimeZone(ZoneId zoneId)
获取给定
zoneId 的
TimeZone 。
|
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.