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

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

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

ZoneRules.getTransitionRules介绍

[英]Gets the list of transition rules for years beyond those defined in the transition list.

The complete set of transitions for this rules instance is defined by this method and #getTransitions(). This method returns instances of ZoneOffsetTransitionRulethat define an algorithm for when transitions will occur.

For any given ZoneRules, this list contains the transition rules for years beyond those years that have been fully defined. These rules typically refer to future daylight saving time rule changes.

If the zone defines daylight savings into the future, then the list will normally be of size two and hold information about entering and exiting daylight savings. If the zone does not have daylight savings, or information about future changes is uncertain, then the list will be empty.

The list will be empty for fixed offset rules and for any time-zone where there is no daylight saving time. The list will also be empty if the transition rules are unknown.
[中]获取超出转换列表中定义的转换规则数年的转换规则列表。
此规则实例的完整转换集由此方法和#getTransitions()定义。此方法返回ZoneOffsetTransitionRule的实例,这些实例定义了何时发生转换的算法。
对于任何给定的ZoneRules,此列表包含已完全定义年份之后的过渡规则。这些规则通常指未来夏令时规则的更改。
如果该区域定义了未来的夏令时,那么该列表通常会有两个大小,并保存有关进入和退出夏令时的信息。如果该区域没有夏令时,或者关于未来变化的信息不确定,那么列表将为空。
对于固定偏移规则和任何没有夏令时的时区,该列表将为空。如果转换规则未知,列表也将为空。

代码示例

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

zi.getRules().getOffset(instant).toString());
p.printf("%swatch service: %s%n", indent, getServer().getWatchServiceClassname());
List<ZoneOffsetTransitionRule> l = zi.getRules().getTransitionRules();
for (ZoneOffsetTransitionRule tr : l) {
  p.printf("%s         rule: %s%n", indent, tr.toString());

代码示例来源: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: org.mnode.ical4j/ical4j

for (ZoneOffsetTransitionRule transitionRule : zoneId.getRules().getTransitionRules()) {
  int transitionRuleMonthValue = transitionRule.getMonth().getValue();
  DayOfWeek transitionRuleDayOfWeek = transitionRule.getDayOfWeek();

代码示例来源:origin: ical4j/ical4j

for (ZoneOffsetTransitionRule transitionRule : zoneId.getRules().getTransitionRules()) {
  int transitionRuleMonthValue = transitionRule.getMonth().getValue();
  DayOfWeek transitionRuleDayOfWeek = transitionRule.getDayOfWeek();

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

for (ZoneOffsetTransitionRule zotr : zoneRules.getTransitionRules()) {
  DaylightSavingRule rule;

相关文章