gpt4 book ai didi

java.time.ZoneOffset.normalized()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 13:16:40 28 4
gpt4 key购买 nike

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

ZoneOffset.normalized介绍

暂无

代码示例

代码示例来源:origin: FINRAOS/DataGenerator

@Override
  public LocalDateTime next(TransformationContext context) {
    if(direction.equals(Direction.ASCENDING)) {
      return LocalDateTime.ofInstant(Instant.ofEpochMilli(current.getAndAdd(step.toMillis())), this.offset.normalized());
    } else {
      return LocalDateTime.ofInstant(Instant.ofEpochMilli(current.getAndAdd(step.toMillis() * -1)), this.offset.normalized());
    }
  }
}

代码示例来源:origin: org.cactoos/cactoos

/**
 * Parses date using the provided format to create
 *  {@link OffsetDateTime} instances.
 * @param date The date to parse.
 * @param format The format to use.
 * @param offset The offset to use.
 */
public OffsetDateTimeOf(final CharSequence date, final String format,
  final ZoneOffset offset) {
  this(date,
    DateTimeFormatter.ofPattern(format).withZone(offset.normalized())
  );
}

代码示例来源:origin: yegor256/cactoos

/**
 * Parses date using the provided format to create
 *  {@link OffsetDateTime} instances.
 * @param date The date to parse.
 * @param format The format to use.
 * @param offset The offset to use.
 */
public OffsetDateTimeOf(final CharSequence date, final String format,
  final ZoneOffset offset) {
  this(date,
    DateTimeFormatter.ofPattern(format).withZone(offset.normalized())
  );
}

代码示例来源:origin: exoplatform/platform

@Override
public LocalDateTime getLastCheckedTime(IDMEntityType<?> entityType) {
 if (entityType == null) {
  throw new IllegalArgumentException("entityType is null");
 }
 SettingValue<?> settingValue = settingService.get(Context.GLOBAL,
                          IDM_SCOPE,
                          "DATE-" + entityType.getClassType().getSimpleName());
 if (settingValue == null) {
  return null;
 } else {
  Object value = settingValue.getValue();
  long timestamp;
  if (value instanceof Long) {
   timestamp = (Long) value;
  } else if (value instanceof String) {
   timestamp = Long.parseLong(String.valueOf(value));
  } else {
   LOG.warn("value of type" + value.getClass().getSimpleName() + " is not recognized");
   return null;
  }
  LocalDateTime dateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(timestamp), ZoneOffset.UTC.normalized());
  return dateTime;
 }
}

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