gpt4 book ai didi

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

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

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

ZonalOffset.toString介绍

[英]Returns a complete short representation of this shift including the sign.

Notes: If there are only full minutes or hours the representation is exactly as described in ISO-8601. Another long canonical representation can be obtained by the method canonical().
[中]返回此移位的完整简短表示形式,包括符号。
注:如果只有整分钟或整小时,则表示形式与ISO-8601中的描述完全相同。另一个长规范表示可以通过canonical()方法获得。

代码示例

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

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

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

private String getOffsetAsString() {
  if ((this.offset.getIntegralAmount() == 0) && (this.offset.getFractionalAmount() == 0)) {
    return "Z";
  }
  return this.offset.toString();
}

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

@Override
public String getDisplayName(
  NameStyle style,
  Locale locale
) {
  return (
    style.isAbbreviation()
    ? this.offset.toString()
    : this.offset.canonical()
  );
}

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

@Override
public ZonedDateTime from(ZonalDateTime zdt) {
  Instant instant = TemporalType.INSTANT.from(zdt.toMoment());
  ZoneId zone;
  try {
    zone = ZoneId.of(zdt.getTimezone().canonical());
  } catch (DateTimeException ex) {
    ZonalOffset zo = Timezone.of(zdt.getTimezone()).getOffset(zdt.toMoment());
    zone = ZoneOffset.of(zo.toString());
  }
  return ZonedDateTime.ofInstant(instant, zone);
}

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

: this.tzid);
Timezone tz = Timezone.of(timezone);
String replaceTZ = "GMT" + tz.getOffset(moment).toString();
XCalendar gcal = new XCalendar(TimeZone.getTimeZone(replaceTZ), this.locale);
SimpleDateFormat sdf = setUp(this.pattern, this.locale, gcal, !this.leniency.isStrict());

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