本文整理汇总了Java中java.time.LocalDate.toEpochDay方法的典型用法代码示例。如果您正苦于以下问题:Java LocalDate.toEpochDay方法的具体用法?Java LocalDate.toEpochDay怎么用?Java LocalDate.toEpochDay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.time.LocalDate
的用法示例。
在下文中一共展示了LocalDate.toEpochDay方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import java.time.LocalDate; //导入方法依赖的package包/类
@BeforeMethod
public void setUp() {
TEST_2007_07_15 = LocalDate.of(2007, 7, 15);
LocalDate max = LocalDate.MAX;
LocalDate min = LocalDate.MIN;
MAX_VALID_EPOCHDAYS = max.toEpochDay();
MIN_VALID_EPOCHDAYS = min.toEpochDay();
MAX_DATE = max;
MIN_DATE = min;
MAX_INSTANT = max.atStartOfDay(ZoneOffset.UTC).toInstant();
MIN_INSTANT = min.atStartOfDay(ZoneOffset.UTC).toInstant();
}
示例2: encodeInternal
import java.time.LocalDate; //导入方法依赖的package包/类
@Override
ByteBuffer encodeInternal(LocalDate input) {
int unsigned = (int) input.toEpochDay() - Integer.MIN_VALUE;
return cint.encode(unsigned);
}
示例3: setTradeDate
import java.time.LocalDate; //导入方法依赖的package包/类
@Override
public void setTradeDate(LocalDate tradeDate) {
long millis = tradeDate.toEpochDay();
writeWord(millis, 8);
}
示例4: setSettlementDate
import java.time.LocalDate; //导入方法依赖的package包/类
@Override
public void setSettlementDate(LocalDate settlementDate) {
long millis = settlementDate.toEpochDay();
writeWord(millis, 37);
}
示例5: getCode
import java.time.LocalDate; //导入方法依赖的package包/类
@Override
public final long getCode(LocalDate value) {
return value == null ? Long.MIN_VALUE : value.toEpochDay();
}