Java Code Examples for org.threeten.bp.LocalDate#ofEpochDay()

The following examples show how to use org.threeten.bp.LocalDate#ofEpochDay() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TemporalQueries.java    From threetenbp with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
@Override
public LocalDate queryFrom(TemporalAccessor temporal) {
    if (temporal.isSupported(EPOCH_DAY)) {
        return LocalDate.ofEpochDay(temporal.getLong(EPOCH_DAY));
    }
    return null;
}
 
Example 2
Source File: DateTimeBuilder.java    From threetenbp with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
private void resolveMakeChanges(TemporalField targetField, ChronoLocalDate date) {
    if (chrono.equals(date.getChronology()) == false) {
        throw new DateTimeException("ChronoLocalDate must use the effective parsed chronology: " + chrono);
    }
    long epochDay = date.toEpochDay();
    Long old = fieldValues.put(ChronoField.EPOCH_DAY, epochDay);
    if (old != null && old.longValue() != epochDay) {
        throw new DateTimeException("Conflict found: " + LocalDate.ofEpochDay(old) +
                " differs from " + LocalDate.ofEpochDay(epochDay) +
                " while resolving  " + targetField);
    }
}
 
Example 3
Source File: IsoChronology.java    From threetenbp with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public LocalDate dateEpochDay(long epochDay) {
    return LocalDate.ofEpochDay(epochDay);
}
 
Example 4
Source File: JapaneseChronology.java    From threetenbp with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public JapaneseDate dateEpochDay(long epochDay) {
    return new JapaneseDate(LocalDate.ofEpochDay(epochDay));
}
 
Example 5
Source File: MinguoChronology.java    From threetenbp with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public MinguoDate dateEpochDay(long epochDay) {
    return new MinguoDate(LocalDate.ofEpochDay(epochDay));
}
 
Example 6
Source File: ThaiBuddhistChronology.java    From threetenbp with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
@Override
public ThaiBuddhistDate dateEpochDay(long epochDay) {
    return new ThaiBuddhistDate(LocalDate.ofEpochDay(epochDay));
}