org.threeten.bp.zone.ZoneOffsetTransition.getInstant()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(88)

本文整理了Java中org.threeten.bp.zone.ZoneOffsetTransition.getInstant()方法的一些代码示例,展示了ZoneOffsetTransition.getInstant()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneOffsetTransition.getInstant()方法的具体详情如下:
包路径:org.threeten.bp.zone.ZoneOffsetTransition
类名称:ZoneOffsetTransition
方法名:getInstant

ZoneOffsetTransition.getInstant介绍

[英]Gets the transition instant.

This is the instant of the discontinuity, which is defined as the first instant that the 'after' offset applies.

The methods #getInstant(), #getDateTimeBefore() and #getDateTimeAfter()all represent the same instant.
[中]获取转换瞬间。
这是不连续的瞬间,定义为“后”偏移应用的第一个瞬间。
方法#getInstant()、#getDateTimeBefore()和#getDateTimeAfter()都代表同一个瞬间。

代码示例

代码示例来源:origin: stackoverflow.com

ZoneId zoneId = ZoneId.of("Australia/Sydney");
ZoneRules rules = zoneId.getRules();

ZoneOffsetTransition nextTransition = rules.nextTransition(Instant.now());
System.out.println("Next transition at: " +
    nextTransition.getInstant().atZone(zoneId));

ZoneOffsetTransition nextNextTransition =
    rules.nextTransition(nextTransition.getInstant());
System.out.println("Next transition after that at: " +
    nextNextTransition.getInstant().atZone(zoneId));

代码示例来源:origin: ThreeTen/threetenbp

/**
 * Compares this transition to another based on the transition instant.
 * <p>
 * This compares the instants of each transition.
 * The offsets are ignored, making this order inconsistent with equals.
 *
 * @param transition  the transition to compare to, not null
 * @return the comparator value, negative if less, positive if greater
 */
@Override
public int compareTo(ZoneOffsetTransition transition) {
  return this.getInstant().compareTo(transition.getInstant());
}

代码示例来源:origin: org.threeten/threetenbp

/**
 * Compares this transition to another based on the transition instant.
 * <p>
 * This compares the instants of each transition.
 * The offsets are ignored, making this order inconsistent with equals.
 *
 * @param transition  the transition to compare to, not null
 * @return the comparator value, negative if less, positive if greater
 */
@Override
public int compareTo(ZoneOffsetTransition transition) {
  return this.getInstant().compareTo(transition.getInstant());
}

代码示例来源:origin: stackoverflow.com

public boolean isExtraHour(final ZonedDateTime time) {
  final ZoneOffsetTransition dayTransition = time.getZone().getRules()
      .getTransition(time.toLocalDateTime());

  return dayTransition != null && dayTransition.isOverlap() && dayTransition.getInstant()
      .equals(time.toInstant());
}

代码示例来源:origin: ThreeTen/threetenbp

this.savingsInstantTransitions[i] = transitionList.get(i).getInstant().getEpochSecond();

代码示例来源:origin: org.threeten/threetenbp

this.savingsInstantTransitions[i] = transitionList.get(i).getInstant().getEpochSecond();

相关文章