gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-14 08:28:49 29 4
gpt4 key购买 nike

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

ZoneOffsetTransition.getDuration介绍

[英]Gets the duration of the transition.

In most cases, the transition duration is one hour, however this is not always the case. The duration will be positive for a gap and negative for an overlap. Time-zones are second-based, so the nanosecond part of the duration will be zero.
[中]获取转换的持续时间。
在大多数情况下,过渡持续时间为一小时,但情况并非总是如此。对于间隙,持续时间为正,对于重叠,持续时间为负。时区是以秒为基础的,因此持续时间的纳秒部分将为零。

代码示例

代码示例来源:origin: com.vaadin/vaadin-server

.ofSeconds(t.getInstant().getEpochSecond())
    .toHours();
long duration = Math.max(t.getDuration().toMinutes(), 0);
transitionsList.add(epochHours);
transitionsList.add(duration);

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

} else if (validOffsets.size() == 0) {
  ZoneOffsetTransition trans = rules.getTransition(isoLDT);
  localDateTime = localDateTime.plusSeconds(trans.getDuration().getSeconds());
  offset = trans.getOffsetAfter();
} else {

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

} else if (validOffsets.size() == 0) {
  ZoneOffsetTransition trans = rules.getTransition(localDateTime);
  localDateTime = localDateTime.plusSeconds(trans.getDuration().getSeconds());
  offset = trans.getOffsetAfter();
} else {

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