/** * Checks if the instant of this date-time is equal to that of the specified date-time. * <p> * This method differs from the comparison in {@link #compareTo} and {@link #equals} * in that it only compares the instant of the date-time. This is equivalent to using * {@code dateTime1.toInstant().equals(dateTime2.toInstant());}. * * @param other the other date-time to compare to, not null * @return true if the instant equals the instant of the specified date-time */ public boolean isEqual(OffsetDateTime other) { return toEpochSecond() == other.toEpochSecond() && toLocalTime().getNano() == other.toLocalTime().getNano(); }
/** * Checks if the instant of this date-time is equal to that of the specified date-time. * <p> * This method differs from the comparison in {@link #compareTo} and {@link #equals} * in that it only compares the instant of the date-time. This is equivalent to using * {@code dateTime1.toInstant().equals(dateTime2.toInstant());}. * * @param other the other date-time to compare to, not null * @return true if the instant equals the instant of the specified date-time */ public boolean isEqual(OffsetDateTime other) { return toEpochSecond() == other.toEpochSecond() && toLocalTime().getNano() == other.toLocalTime().getNano(); }
/** * Checks if the instant of this date-time is after that of the specified date-time. * <p> * This method differs from the comparison in {@link #compareTo} and {@link #equals} in that it * only compares the instant of the date-time. This is equivalent to using * {@code dateTime1.toInstant().isAfter(dateTime2.toInstant());}. * * @param other the other date-time to compare to, not null * @return true if this is after the instant of the specified date-time */ public boolean isAfter(OffsetDateTime other) { long thisEpochSec = toEpochSecond(); long otherEpochSec = other.toEpochSecond(); return thisEpochSec > otherEpochSec || (thisEpochSec == otherEpochSec && toLocalTime().getNano() > other.toLocalTime().getNano()); }
/** * Checks if the instant of this date-time is before that of the specified date-time. * <p> * This method differs from the comparison in {@link #compareTo} in that it * only compares the instant of the date-time. This is equivalent to using * {@code dateTime1.toInstant().isBefore(dateTime2.toInstant());}. * * @param other the other date-time to compare to, not null * @return true if this is before the instant of the specified date-time */ public boolean isBefore(OffsetDateTime other) { long thisEpochSec = toEpochSecond(); long otherEpochSec = other.toEpochSecond(); return thisEpochSec < otherEpochSec || (thisEpochSec == otherEpochSec && toLocalTime().getNano() < other.toLocalTime().getNano()); }
/** * Checks if the instant of this date-time is after that of the specified date-time. * <p> * This method differs from the comparison in {@link #compareTo} and {@link #equals} in that it * only compares the instant of the date-time. This is equivalent to using * {@code dateTime1.toInstant().isAfter(dateTime2.toInstant());}. * * @param other the other date-time to compare to, not null * @return true if this is after the instant of the specified date-time */ public boolean isAfter(OffsetDateTime other) { long thisEpochSec = toEpochSecond(); long otherEpochSec = other.toEpochSecond(); return thisEpochSec > otherEpochSec || (thisEpochSec == otherEpochSec && toLocalTime().getNano() > other.toLocalTime().getNano()); }
/** * Checks if the instant of this date-time is before that of the specified date-time. * <p> * This method differs from the comparison in {@link #compareTo} in that it * only compares the instant of the date-time. This is equivalent to using * {@code dateTime1.toInstant().isBefore(dateTime2.toInstant());}. * * @param other the other date-time to compare to, not null * @return true if this is before the instant of the specified date-time */ public boolean isBefore(OffsetDateTime other) { long thisEpochSec = toEpochSecond(); long otherEpochSec = other.toEpochSecond(); return thisEpochSec < otherEpochSec || (thisEpochSec == otherEpochSec && toLocalTime().getNano() < other.toLocalTime().getNano()); }
mTopicBean.getFormattedPublishDate().toLocalTime().toString().substring(0, 8)); } else { mTxtTopicTime.setVisibility(View.GONE);
cmp = toLocalTime().getNano() - other.toLocalTime().getNano(); if (cmp == 0) { cmp = toLocalDateTime().compareTo(other.toLocalDateTime());
cmp = toLocalTime().getNano() - other.toLocalTime().getNano(); if (cmp == 0) { cmp = toLocalDateTime().compareTo(other.toLocalDateTime());
return temporal .with(EPOCH_DAY, toLocalDate().toEpochDay()) .with(NANO_OF_DAY, toLocalTime().toNanoOfDay()) .with(OFFSET_SECONDS, getOffset().getTotalSeconds());
return temporal .with(EPOCH_DAY, toLocalDate().toEpochDay()) .with(NANO_OF_DAY, toLocalTime().toNanoOfDay()) .with(OFFSET_SECONDS, getOffset().getTotalSeconds());
return (R) toLocalDate(); } else if (query == TemporalQueries.localTime()) { return (R) toLocalTime(); } else if (query == TemporalQueries.zoneId()) { return null;
return (R) toLocalDate(); } else if (query == TemporalQueries.localTime()) { return (R) toLocalTime(); } else if (query == TemporalQueries.zoneId()) { return null;