--- old/src/java.base/share/classes/java/time/LocalDate.java 2015-11-30 14:40:01.077101000 +0300 +++ new/src/java.base/share/classes/java/time/LocalDate.java 2015-11-30 14:40:00.887101000 +0300 @@ -1863,6 +1863,22 @@ return total - DAYS_0000_TO_1970; } + /** + * Converts this {@code LocalDate} to the number of seconds since the epoch + * of 1970-01-01T00:00:00Z. + *

+ * This returns the number of seconds from the epoch for this {@link LocalDate}. + * + * @param offset the zone offset, not null + * @return the number of seconds since the epoch of 1970-01-01T00:00:00Z, may be negative + */ + public long toEpochSecond(ZoneOffset offset) { + Objects.requireNonNull(offset, "offset"); + long secs = toEpochDay() * SECONDS_PER_DAY; + secs -= offset.getTotalSeconds(); + return secs; + } + //----------------------------------------------------------------------- /** * Compares this date to another date.