734 * @param zoneOffset the zone offset, not null |
734 * @param zoneOffset the zone offset, not null |
735 * @return the number of seconds relative to 1970-01-01T00:00:00Z, may be negative |
735 * @return the number of seconds relative to 1970-01-01T00:00:00Z, may be negative |
736 * @throws DateTimeException if any of the values are out of range |
736 * @throws DateTimeException if any of the values are out of range |
737 * @since 9 |
737 * @since 9 |
738 */ |
738 */ |
739 public default long epochSecond(int prolepticYear, int month, int dayOfMonth, |
739 public default long epochSecond(int prolepticYear, int month, int dayOfMonth, |
740 int hour, int minute, int second, ZoneOffset zoneOffset) { |
740 int hour, int minute, int second, ZoneOffset zoneOffset) { |
741 Objects.requireNonNull(zoneOffset, "zoneOffset"); |
741 Objects.requireNonNull(zoneOffset, "zoneOffset"); |
742 HOUR_OF_DAY.checkValidValue(hour); |
742 HOUR_OF_DAY.checkValidValue(hour); |
743 MINUTE_OF_HOUR.checkValidValue(minute); |
743 MINUTE_OF_HOUR.checkValidValue(minute); |
744 SECOND_OF_MINUTE.checkValidValue(second); |
744 SECOND_OF_MINUTE.checkValidValue(second); |
745 long daysInSec = Math.multiplyExact(date(prolepticYear, month, dayOfMonth).toEpochDay(), 86400); |
745 long daysInSec = Math.multiplyExact(date(prolepticYear, month, dayOfMonth).toEpochDay(), 86400); |
763 * @param zoneOffset the zone offset, not null |
763 * @param zoneOffset the zone offset, not null |
764 * @return the number of seconds relative to 1970-01-01T00:00:00Z, may be negative |
764 * @return the number of seconds relative to 1970-01-01T00:00:00Z, may be negative |
765 * @throws DateTimeException if any of the values are out of range |
765 * @throws DateTimeException if any of the values are out of range |
766 * @since 9 |
766 * @since 9 |
767 */ |
767 */ |
768 public default long epochSecond(Era era, int yearOfEra, int month, int dayOfMonth, |
768 public default long epochSecond(Era era, int yearOfEra, int month, int dayOfMonth, |
769 int hour, int minute, int second, ZoneOffset zoneOffset) { |
769 int hour, int minute, int second, ZoneOffset zoneOffset) { |
770 Objects.requireNonNull(era, "era"); |
770 Objects.requireNonNull(era, "era"); |
771 return epochSecond(prolepticYear(era, yearOfEra), month, dayOfMonth, hour, minute, second, zoneOffset); |
771 return epochSecond(prolepticYear(era, yearOfEra), month, dayOfMonth, hour, minute, second, zoneOffset); |
772 } |
772 } |
773 //----------------------------------------------------------------------- |
773 //----------------------------------------------------------------------- |
774 /** |
774 /** |