软件包 | 描述 |
---|---|
java.time |
日期、时间、时刻主要的API,和持续时间。
|
java.time.chrono |
除了默认的标准以外的日历系统的通用的。
|
java.time.temporal |
访问日期和时间的应用领域和单位,时间和日期的调节。
|
java.time.zone |
支持时区及其规则。
|
Modifier and Type | Field and Description |
---|---|
static ZoneOffset |
ZoneOffset.MAX
最大支持偏移量的常数。
|
static ZoneOffset |
ZoneOffset.MIN
最大支持偏移量的常数。
|
static ZoneOffset |
ZoneOffset.UTC
时区偏移时,用“Z”身份。
|
Modifier and Type | Method and Description |
---|---|
static ZoneOffset |
ZoneOffset.from(TemporalAccessor temporal)
获得
ZoneOffset 实例从一个时空对象。
|
ZoneOffset |
OffsetTime.getOffset()
能带偏移,如“+”01:00。
|
ZoneOffset |
OffsetDateTime.getOffset()
能带偏移,如“+”01:00。
|
ZoneOffset |
ZonedDateTime.getOffset()
能带偏移,如“+”01:00。
|
static ZoneOffset |
ZoneOffset.of(String offsetId)
得到一个实例
ZoneOffset 使用ID。
|
static ZoneOffset |
ZoneOffset.ofHours(int hours)
得到一个实例
ZoneOffset 使用偏移时间。
|
static ZoneOffset |
ZoneOffset.ofHoursMinutes(int hours, int minutes)
得到一个实例
ZoneOffset 以小时和分钟偏移。
|
static ZoneOffset |
ZoneOffset.ofHoursMinutesSeconds(int hours, int minutes, int seconds)
获得使用小时偏移
ZoneOffset 实例,分钟和秒。
|
static ZoneOffset |
ZoneOffset.ofTotalSeconds(int totalSeconds)
获得
ZoneOffset 指定总秒偏移实例
|
Modifier and Type | Method and Description |
---|---|
OffsetDateTime |
Instant.atOffset(ZoneOffset offset)
结合即时的偏移来创建一个
OffsetDateTime 。
|
OffsetTime |
LocalTime.atOffset(ZoneOffset offset)
结合这一次的偏移来创建一个
OffsetTime 。
|
OffsetDateTime |
LocalDateTime.atOffset(ZoneOffset offset)
结合这个日期时间偏移来创建一个
OffsetDateTime 。
|
int |
ZoneOffset.compareTo(ZoneOffset other)
将此偏移量与另一个递减顺序的偏移量进行比较。
|
static OffsetDateTime |
OffsetDateTime.of(int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, ZoneOffset offset)
获得
OffsetDateTime 实例从年,月,日,小时,分钟,秒,纳秒和偏移。
|
static OffsetTime |
OffsetTime.of(int hour, int minute, int second, int nanoOfSecond, ZoneOffset offset)
获得
OffsetTime 实例每小时,,二和纳秒。
|
static OffsetDateTime |
OffsetDateTime.of(LocalDate date, LocalTime time, ZoneOffset offset)
获得
OffsetDateTime 实例从一个日期,时间和偏移。
|
static OffsetDateTime |
OffsetDateTime.of(LocalDateTime dateTime, ZoneOffset offset)
从一个日期时间得到
OffsetDateTime 实例和偏移。
|
static OffsetTime |
OffsetTime.of(LocalTime time, ZoneOffset offset)
获得
OffsetTime 实例从本地时间偏移。
|
static LocalDateTime |
LocalDateTime.ofEpochSecond(long epochSecond, int nanoOfSecond, ZoneOffset offset)
获得由1970-01-01t00:00:00z时代秒
LocalDateTime 实例。
|
static ZonedDateTime |
ZonedDateTime.ofInstant(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone)
获得
ZonedDateTime 实例从结合当地的日期时间和偏移形成的瞬间。
|
static ZonedDateTime |
ZonedDateTime.ofLocal(LocalDateTime localDateTime, ZoneId zone, ZoneOffset preferredOffset)
获得
ZonedDateTime 实例从使用首选本地日期时间如果可能抵消。
|
static ZoneId |
ZoneId.ofOffset(String prefix, ZoneOffset offset)
获得
ZoneId 包装胶印的实例。
|
static ZonedDateTime |
ZonedDateTime.ofStrict(LocalDateTime localDateTime, ZoneOffset offset, ZoneId zone)
获得
ZonedDateTime 严格验证本地日期时间结合的实例,偏移和区域ID。
|
OffsetTime |
OffsetTime.withOffsetSameInstant(ZoneOffset offset)
返回一份本
OffsetTime 与指定的偏移量确保结果是在一个隐含的同一瞬间。
|
OffsetDateTime |
OffsetDateTime.withOffsetSameInstant(ZoneOffset offset)
返回一份本
OffsetDateTime 与指定的偏移量确保结果是在同一瞬间。
|
OffsetTime |
OffsetTime.withOffsetSameLocal(ZoneOffset offset)
返回一份本
OffsetTime 与指定的偏移量确保结果具有相同的本地时间。
|
OffsetDateTime |
OffsetDateTime.withOffsetSameLocal(ZoneOffset offset)
返回一份本
OffsetDateTime 与指定的偏移量确保结果具有相同的本地日期时间。
|
Modifier and Type | Method and Description |
---|---|
ZoneOffset |
ChronoZonedDateTime.getOffset()
能带偏移,如“+”01:00。
|
Modifier and Type | Method and Description |
---|---|
default long |
ChronoLocalDateTime.toEpochSecond(ZoneOffset offset)
将此日期时间的秒数从1970-01-01t00:00:00z时代。
|
default Instant |
ChronoLocalDateTime.toInstant(ZoneOffset offset)
将这一
Instant 日期时间。
|
Modifier and Type | Method and Description |
---|---|
static TemporalQuery<ZoneOffset> |
TemporalQueries.offset()
对于
ZoneOffset 返回null查询,如果没有找到。
|
Modifier and Type | Method and Description |
---|---|
ZoneOffset |
ZoneRules.getOffset(Instant instant)
获取在这些规则中指定的即时应用的偏移量。
|
ZoneOffset |
ZoneRules.getOffset(LocalDateTime localDateTime)
获取在这些规则中指定的本地日期时间的适当偏移量。
|
ZoneOffset |
ZoneOffsetTransition.getOffsetAfter()
转换后得到偏移量。
|
ZoneOffset |
ZoneOffsetTransitionRule.getOffsetAfter()
转换后得到偏移量。
|
ZoneOffset |
ZoneOffsetTransition.getOffsetBefore()
获取过渡前的偏移量。
|
ZoneOffset |
ZoneOffsetTransitionRule.getOffsetBefore()
获取过渡前的偏移量。
|
ZoneOffset |
ZoneOffsetTransitionRule.getStandardOffset()
在过渡处获取标准偏移量。
|
ZoneOffset |
ZoneRules.getStandardOffset(Instant instant)
获取此区域中指定的即时的标准偏移量。
|
Modifier and Type | Method and Description |
---|---|
List<ZoneOffset> |
ZoneRules.getValidOffsets(LocalDateTime localDateTime)
获取在这些规则中指定的本地日期时间中的应用的偏移量。
|
Modifier and Type | Method and Description |
---|---|
LocalDateTime |
ZoneOffsetTransitionRule.TimeDefinition.createDateTime(LocalDateTime dateTime, ZoneOffset standardOffset, ZoneOffset wallOffset)
将指定的本地日期时间转换为实际在墙上时钟上看到的本地日期时间。
|
boolean |
ZoneRules.isValidOffset(LocalDateTime localDateTime, ZoneOffset offset)
检查偏移日期时间是否有效,为这些规则。
|
boolean |
ZoneOffsetTransition.isValidOffset(ZoneOffset offset)
检查在此过渡期间是否有效的指定偏移量是否有效。
|
static ZoneOffsetTransition |
ZoneOffsetTransition.of(LocalDateTime transition, ZoneOffset offsetBefore, ZoneOffset offsetAfter)
获取一个定义两个偏移量之间的过渡的实例。
|
static ZoneOffsetTransitionRule |
ZoneOffsetTransitionRule.of(Month month, int dayOfMonthIndicator, DayOfWeek dayOfWeek, LocalTime time, boolean timeEndOfDay, ZoneOffsetTransitionRule.TimeDefinition timeDefnition, ZoneOffset standardOffset, ZoneOffset offsetBefore, ZoneOffset offsetAfter)
获得一个定义年度规则的实例,以创建两个偏移之间的转换。
|
static ZoneRules |
ZoneRules.of(ZoneOffset offset)
得到ZoneRules有固定区域规则的实例。
|
static ZoneRules |
ZoneRules.of(ZoneOffset baseStandardOffset, ZoneOffset baseWallOffset, List<ZoneOffsetTransition> standardOffsetTransitionList, List<ZoneOffsetTransition> transitionList, List<ZoneOffsetTransitionRule> lastRules)
得到一个zonerules实例。
|
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.