本文整理了Java中java.time.temporal.ChronoUnit.addTo()
方法的一些代码示例,展示了ChronoUnit.addTo()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ChronoUnit.addTo()
方法的具体详情如下:
包路径:java.time.temporal.ChronoUnit
类名称: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;
内容来源于网络,如有侵权,请联系作者删除!