java.time.zone.ZoneOffsetTransition.getInstant()方法的使用及代码示例

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

本文整理了Java中java.time.zone.ZoneOffsetTransition.getInstant()方法的一些代码示例,展示了ZoneOffsetTransition.getInstant()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneOffsetTransition.getInstant()方法的具体详情如下:
包路径:java.time.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: com.vaadin/vaadin-server

break;
i = t.getInstant().atZone(zoneId);
if (i.toLocalDate().getYear() != year) {
  break;
    .ofSeconds(t.getInstant().getEpochSecond())
    .toHours();
long duration = Math.max(t.getDuration().toMinutes(), 0);

代码示例来源:origin: com.github.seratch/java-time-backport

/**
 * 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: com.github.seratch/java-time-backport

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

代码示例来源:origin: jpos/jPOS

Instant in = tran.getInstant();
p.printf("%s   transition: %s (%s)%n", indent, in, in.atZone(zi));

代码示例来源:origin: jpos/jPOS

public void exec(CLIContext cli, String[] args) throws Exception
  {
    ZoneId zi = ZoneId.systemDefault();
    Instant i = Instant.now();
    cli.println(
      "         Zone ID: " + zi + " (" + zi.getDisplayName(TextStyle.FULL, Locale.getDefault()) + ") "
        + zi.getRules().getOffset(i)
    );
    cli.println ("             UTC: " + i);
    ZoneOffsetTransition tran = zi.getRules().nextTransition(i);
    if (tran != null) {
      Instant in = tran.getInstant();
      cli.println (" Next transition: " + in + " (" + in.atZone(zi) + ")");
    }
    List<ZoneOffsetTransitionRule> l = zi.getRules().getTransitionRules();
    for (ZoneOffsetTransitionRule r : l) {
      cli.println (" Transition rule: " + r);
    }
  }
}

代码示例来源:origin: net.time4j/time4j-olson

Instant instant = zot.getInstant();
long posixTime = instant.getEpochSecond();
int previousOffset = zot.getOffsetBefore().getTotalSeconds();

相关文章