java.time.temporal.ChronoUnit.addTo()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(144)

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

ChronoUnit.addTo介绍

暂无

代码示例

代码示例来源:origin: optimatika/ojAlgo

@SuppressWarnings({ "unchecked" })
public <R extends Temporal> R addTo(final R temporal, final long amount) {
  if (temporal instanceof CalendarDate) {
    return (R) new CalendarDate(((CalendarDate) temporal).millis + this.toDurationInMillis());
  } else if (myChronoUnit != null) {
    return myChronoUnit.addTo(temporal, amount);
  } else { // QUARTER
    return ChronoUnit.MONTHS.addTo(temporal, 3L * amount);
  }
}

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

@SuppressWarnings({ "unchecked" })
public <R extends Temporal> R addTo(final R temporal, final long amount) {
  if (temporal instanceof CalendarDate) {
    return (R) new CalendarDate(((CalendarDate) temporal).millis + this.toDurationInMillis());
  } else if (myChronoUnit != null) {
    return myChronoUnit.addTo(temporal, amount);
  } else { // QUARTER
    return ChronoUnit.MONTHS.addTo(temporal, 3L * amount);
  }
}

代码示例来源:origin: Netflix/iceberg

static String humanTimestampWithZone(Long timestampMicros) {
 return ChronoUnit.MICROS.addTo(EPOCH, timestampMicros).toString();
}

代码示例来源:origin: Netflix/iceberg

@Override
 public String read(String ignored) {
  return ChronoUnit.MICROS.addTo(EPOCH, column.nextLong()).toString();
 }
}

代码示例来源:origin: Netflix/iceberg

@Override
 public String read(String ignored) {
  return ChronoUnit.MILLIS.addTo(EPOCH, column.nextLong()).toString();
 }
}

代码示例来源:origin: Netflix/iceberg

static String humanTimestampWithoutZone(Long timestampMicros) {
 return ChronoUnit.MICROS.addTo(EPOCH, timestampMicros).toLocalDateTime().toString();
}

代码示例来源:origin: Netflix/iceberg

Assert.assertTrue("Should be a Date", actual instanceof Date);
int daysFrom1970_01_01 = (Integer) expected;
LocalDate date = ChronoUnit.DAYS.addTo(EPOCH_DAY, daysFrom1970_01_01);
Assert.assertEquals("ISO-8601 date should be equal", date.toString(), actual.toString());
break;

相关文章