gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-19 11:51:31 24 4
gpt4 key购买 nike

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

ZonalOffset.ofTotalSeconds介绍

[英]Creates a shift of the local time relative to UTC timezone in integer seconds.
[中]以整数秒为单位创建本地时间相对于UTC时区的偏移。

代码示例

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

/**
 * <p>Creates a shift of the local time relative to UTC timezone
 * in integer seconds. </p>
 *
 * @param   total   total shift in seconds defined in range
 *                  {@code -18 * 3600 <= total <= 18 * 3600}
 * @return  zonal offset in second precision
 * @throws  IllegalArgumentException if range check fails
 * @see     #getIntegralAmount()
 */
/*[deutsch]
 * <p>Konstruiert eine Verschiebung der lokalen Zeit relativ zur
 * UTC-Zeitzone in integralen Sekunden. </p>
 *
 * @param   total   total shift in seconds defined in range
 *                  {@code -18 * 3600 <= total <= 18 * 3600}
 * @return  zonal offset in second precision
 * @throws  IllegalArgumentException if range check fails
 * @see     #getIntegralAmount()
 */
public static ZonalOffset ofTotalSeconds(int total) {
  return ZonalOffset.ofTotalSeconds(total, 0);
}

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

private Object readOffset(
  ObjectInput in,
  byte header
) throws IOException {
  int offset = in.readInt();
  int fraction = 0;
  if ((header & 0x0F) == 1) {
    fraction = in.readInt();
  }
  return ZonalOffset.ofTotalSeconds(offset, fraction);
}

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

static List<ZonalOffset> toList(
  int offset1,
  int offset2
) {
  ZonalOffset zo1 = ZonalOffset.ofTotalSeconds(offset1);
  ZonalOffset zo2 = ZonalOffset.ofTotalSeconds(offset2);
  List<ZonalOffset> offsets = new ArrayList<>(2);
  offsets.add(zo1);
  offsets.add(zo2);
  return Collections.unmodifiableList(offsets);
}

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

@Override
public ZonalOffset getInitialOffset() {
  return ZonalOffset.ofTotalSeconds(
    this.transitions[0].getPreviousOffset());
}

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

private static ZonalOffset fromOffsetMillis(int offsetMillis) {
  // never return any millisecond part
  return ZonalOffset.ofTotalSeconds(
    MathUtils.floorDivide(offsetMillis, 1000));
}

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

@Override
public ZonalOffset getInitialOffset() {
  return ZonalOffset.ofTotalSeconds(this.initial.getTotalOffset());
}

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

map.put("Etc/UTC", ZonalOffset.UTC);
map.put("Etc/UCT", ZonalOffset.UTC);
map.put("Etc/GMT-14", ZonalOffset.ofTotalSeconds(14 * 3600));
map.put("Etc/GMT-13", ZonalOffset.ofTotalSeconds(13 * 3600));
map.put("Etc/GMT-12", ZonalOffset.ofTotalSeconds(12 * 3600));
map.put("Etc/GMT-11", ZonalOffset.ofTotalSeconds(11 * 3600));
map.put("Etc/GMT-10", ZonalOffset.ofTotalSeconds(10 * 3600));
map.put("Etc/GMT-9", ZonalOffset.ofTotalSeconds(9 * 3600));
map.put("Etc/GMT-8", ZonalOffset.ofTotalSeconds(8 * 3600));
map.put("Etc/GMT-7", ZonalOffset.ofTotalSeconds(7 * 3600));
map.put("Etc/GMT-6", ZonalOffset.ofTotalSeconds(6 * 3600));
map.put("Etc/GMT-5", ZonalOffset.ofTotalSeconds(5 * 3600));
map.put("Etc/GMT-4", ZonalOffset.ofTotalSeconds(4 * 3600));
map.put("Etc/GMT-3", ZonalOffset.ofTotalSeconds(3 * 3600));
map.put("Etc/GMT-2", ZonalOffset.ofTotalSeconds(2 * 3600));
map.put("Etc/GMT-1", ZonalOffset.ofTotalSeconds(3600));
map.put("Etc/GMT+1", ZonalOffset.ofTotalSeconds(-3600));
map.put("Etc/GMT+2", ZonalOffset.ofTotalSeconds(-2 * 3600));
map.put("Etc/GMT+3", ZonalOffset.ofTotalSeconds(-3 * 3600));
map.put("Etc/GMT+4", ZonalOffset.ofTotalSeconds(-4 * 3600));
map.put("Etc/GMT+5", ZonalOffset.ofTotalSeconds(-5 * 3600));
map.put("Etc/GMT+6", ZonalOffset.ofTotalSeconds(-6 * 3600));
map.put("Etc/GMT+7", ZonalOffset.ofTotalSeconds(-7 * 3600));
map.put("Etc/GMT+8", ZonalOffset.ofTotalSeconds(-8 * 3600));
map.put("Etc/GMT+9", ZonalOffset.ofTotalSeconds(-9 * 3600));
map.put("Etc/GMT+10", ZonalOffset.ofTotalSeconds(-10 * 3600));
map.put("Etc/GMT+11", ZonalOffset.ofTotalSeconds(-11 * 3600));
map.put("Etc/GMT+12", ZonalOffset.ofTotalSeconds(-12 * 3600));

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

private static String format(int offset) {
  return ZonalOffset.ofTotalSeconds(offset).toString();
}

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

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

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

@Override
public ZonalOffset getOffset(
  GregorianDate localDate,
  WallTime localTime
) {
  List<ZonalOffset> offsets =
    this.history.getValidOffsets(localDate, localTime);
  if (offsets.size() == 1) {
    return offsets.get(0);
  } else {
    ZonalTransition conflict = this.history.getConflictTransition(localDate, localTime);
    return ZonalOffset.ofTotalSeconds(conflict.getTotalOffset());
  }
}

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

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

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

private SingleOffsetTimezone(ZonalOffset offset) {
  super();
  if (offset.getFractionalAmount() == 0) {
    this.offset = offset;
  } else {
    int total = offset.getIntegralAmount();
    if (offset.getFractionalAmount() < 0) {
      total--; // corresponding to floor-divide-algorithm
    }
    this.offset = ZonalOffset.ofTotalSeconds(total);
  }
}

代码示例来源: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

private static Object readCompositeTransitionModel(ObjectInput in)
  throws IOException, ClassNotFoundException {
  List<ZonalTransition> transitions = readTransitions(in);
  return TransitionModel.of(
    ZonalOffset.ofTotalSeconds(transitions.get(0).getPreviousOffset()),
    transitions,
    readRules(in),
    false,
    false);
}

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

return ZonalOffset.ofTotalSeconds(total);

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

return ZonalOffset.ofTotalSeconds(total);
} else if (
  (n == start + 15)
      fraction = -fraction;
    return ZonalOffset.ofTotalSeconds(
      total,
      fraction);

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

private static long getTransitionTime(
  DaylightSavingRule rule,
  int year,
  int shift
) {
  PlainTimestamp tsp = rule.getDate(year).at(rule.getTimeOfDay());
  return tsp.at(ZonalOffset.ofTotalSeconds(shift)).getPosixTime();
}

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

throwInvalidException(date, time, tz);
} else {
  return ZonalOffset.ofTotalSeconds(offset);
  offset = conflict.getPreviousOffset();
return ZonalOffset.ofTotalSeconds(offset);

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

timezone = gcal.getTimeZone().getID();
} else {
  ZonalOffset zo = ZonalOffset.ofTotalSeconds(offset / 1000);
  if (
    (this.tzid != null)

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

ZonalOffset initialOffset = ZonalOffset.ofTotalSeconds(zoneRules.getOffset(Instant.MIN).getTotalSeconds());
List<ZonalTransition> transitions = new ArrayList<>();
List<DaylightSavingRule> rules = new ArrayList<>();

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