net.time4j.tz.ZonalTransition.getStandardOffset()方法的使用及代码示例

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

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

ZonalTransition.getStandardOffset介绍

[英]Returns the standard shift after this transition as difference between total shift and DST-shift (daylight savings).

Negative standard shifts are related to timezones west for Greenwich, positive to timezones east for Greenwich. The addition of the standard shift to POSIX-time yields the standard local time corresponding to winter time.
[中]将此转换后的标准班次作为总班次和DST班次(夏令时)之间的差值返回。
负标准位移与格林威治以西时区相关,与格林威治以东时区相关。将标准移位添加到POSIX时间中,得到与冬季时间相对应的标准本地时间。

代码示例

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

@Override
public ZonalOffset getStandardOffset(UnixTime ut) {
  ZonalTransition t = this.history.getStartTransition(ut);
  return (
    (t == null)
    ? this.history.getInitialOffset()
    : ZonalOffset.ofTotalSeconds(t.getStandardOffset())
  );
}

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

int stdOffset = this.initial.getStandardOffset();

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

int n = rules.size();
int i = 0;
int stdOffset = initial.getStandardOffset();

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

initial.getStandardOffset(),
initial.getStandardOffset(),

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

int stdOffset = this.initial.getStandardOffset();
int n = this.rules.size();
DaylightSavingRule rule = this.rules.get(0);

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

private static ZonalTransition getNextTransition(
  long ut,
  ZonalTransition initial,
  List<DaylightSavingRule> rules
) {
  long start = Math.max(ut, initial.getPosixTime());
  int year = Integer.MIN_VALUE;
  int stdOffset = initial.getStandardOffset();
  ZonalTransition next = null;
  for (int i = 0, n = rules.size(); next == null; i++) {
    DaylightSavingRule rule = rules.get(i % n);
    DaylightSavingRule previous = rules.get((i - 1 + n) % n);
    int shift = getShift(rule, stdOffset, previous.getSavings());
    if (i == 0) {
      year = getYear(rule, start + shift);
    } else if ((i % n) == 0) {
      year++;
    }
    long tt = getTransitionTime(rule, year, shift);
    if (tt > start) {
      next =
        new ZonalTransition(
          tt,
          stdOffset + previous.getSavings(),
          stdOffset + rule.getSavings(),
          rule.getSavings0());
    }
  }
  return next;
}

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

) throws IOException {
  int rawOffset = transition.getStandardOffset();
  boolean newStdOffset = (rawOffset != stdOffset);
  byte first = 0;

相关文章