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

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

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

ZoneRules.isFixedOffset介绍

[英]Checks of the zone rules are fixed, such that the offset never varies.
[中]分区规则的检查是固定的,因此偏移量永远不会变化。

代码示例

代码示例来源:origin: io.airlift/joda-to-java-time-bridge

@Override
public boolean isFixed()
{
  return zoneRules.isFixedOffset();
}

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

/**
 * Normalizes the time-zone ID, returning a {@code ZoneOffset} where possible.
 * <p>
 * The returns a normalized {@code ZoneId} that can be used in place of this ID.
 * The result will have {@code ZoneRules} equivalent to those returned by this object,
 * however the ID returned by {@code getId()} may be different.
 * <p>
 * The normalization checks if the rules of this {@code ZoneId} have a fixed offset.
 * If they do, then the {@code ZoneOffset} equal to that offset is returned.
 * Otherwise {@code this} is returned.
 *
 * @return the time-zone unique ID, not null
 */
public ZoneId normalized() {
  try {
    ZoneRules rules = getRules();
    if (rules.isFixedOffset()) {
      return rules.getOffset(Instant.EPOCH);
    }
  } catch (ZoneRulesException ex) {
    // ignore invalid objects
  }
  return this;
}

代码示例来源:origin: com.helger/ph-oton-bootstrap3-pages

aRow.addCell (aDTZ.getDisplayName (TextStyle.SHORT, aDisplayLocale));
aRow.addCell (Duration.ofSeconds (aZO.getTotalSeconds ()).toString ());
aRow.addCell (EPhotonCoreText.getYesOrNo (aZR.isFixedOffset (), aDisplayLocale));

代码示例来源:origin: com.helger/ph-oton-bootstrap4-pages

aRow.addCell (aDTZ.getDisplayName (TextStyle.SHORT, aDisplayLocale));
aRow.addCell (Duration.ofSeconds (aZO.getTotalSeconds ()).toString ());
aRow.addCell (EPhotonCoreText.getYesOrNo (aZR.isFixedOffset (), aDisplayLocale));

相关文章