当前位置: 首页>>代码示例>>Java>>正文


Java Duration.ofSeconds方法代码示例

本文整理汇总了Java中org.threeten.bp.Duration.ofSeconds方法的典型用法代码示例。如果您正苦于以下问题:Java Duration.ofSeconds方法的具体用法?Java Duration.ofSeconds怎么用?Java Duration.ofSeconds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.threeten.bp.Duration的用法示例。


在下文中一共展示了Duration.ofSeconds方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getDaylightSavings

import org.threeten.bp.Duration; //导入方法依赖的package包/类
@Override
public Duration getDaylightSavings(Instant instant) {
    ZoneOffset standardOffset = getStandardOffset(instant);
    ZoneOffset actualOffset = getOffset(instant);
    return Duration.ofSeconds(actualOffset.getTotalSeconds() - standardOffset.getTotalSeconds());
}
 
开发者ID:ThreeTen,项目名称:threetenbp,代码行数:7,代码来源:StandardZoneRules.java

示例2: everySeconds

import org.threeten.bp.Duration; //导入方法依赖的package包/类
/**
 * Create a schedule builder where events are triggered every {@code seconds}
 *
 * @param hours the number of minutes between events
 * @return a schedule builder generating events every {@code seconds}
 * @throws IllegalArgumentException if {@code minutes} is negative
 */
public static Builder everySeconds(long seconds) {
  return new Builder(Duration.ofSeconds(seconds));
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:11,代码来源:Schedule.java

示例3: getDuration

import org.threeten.bp.Duration; //导入方法依赖的package包/类
/**
 * Gets the duration of the transition.
 * <p>
 * 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.
 *
 * @return the duration of the transition, positive for gaps, negative for overlaps
 */
public Duration getDuration() {
    return Duration.ofSeconds(getDurationSeconds());
}
 
开发者ID:ThreeTen,项目名称:threetenbp,代码行数:13,代码来源:ZoneOffsetTransition.java


注:本文中的org.threeten.bp.Duration.ofSeconds方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。