gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-13 12:57:47 30 4
gpt4 key购买 nike

本文整理了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();

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com