If the amount is zero or null, then this
is returned. This datetime instance is immutable and unaffected by this method call.
@param duration the duration, in millis, to reduce this instant by
@return a copy of this datetime with the duration taken away
@throws ArithmeticException if the new datetime exceeds the capacity of a long
If the amount is zero or null, then this
is returned.
This method is typically used to subtract complex period instances. Subtracting one field is best achieved using methods like {@link #minusYears(int)}. @param period the period to reduce this instant by @return a copy of this instance with the period taken away @throws ArithmeticException if the new datetime exceeds the capacity of a long
this
must be bigger than theparameter or the same
@param duration
@return the result of substracting the two durations
@throws IllegalArgumentException if the parameter is bigger than this
This method returns a new date based on this date with the specified period subtracted. The amount is typically {@link Period} but may be any other type implementingthe {@link TemporalAmount} interface.The calculation is delegated to the specified adjuster, which typically calls back to {@link #minus(long,TemporalUnit)}.
This instance is immutable and unaffected by this method call. @param amount the amount to subtract, not null @return a {@code LocalDate} based on this date with the subtraction made, not null @throws DateTimeException if the subtraction cannot be made @throws ArithmeticException if numeric overflow occurs
This input amount is converted to a {@code Period} using {@code from(TemporalAmount)}. This operates separately on the years, months and days.
For example, "1 year, 6 months and 3 days" minus "2 years, 2 months and 2 days" returns "-1 years, 4 months and 1 day".
This instance is immutable and unaffected by this method call. @param amountToSubtract the period to subtract, not null @return a {@code Period} based on this period with the requested period subtracted, not null @throws ArithmeticException if numeric overflow occurs
This method returns a new date-time based on this time with the specified period subtracted. The amount is typically {@link Period} but may be any other type implementingthe {@link TemporalAmount} interface.The calculation is delegated to the specified adjuster, which typically calls back to {@link #minus(long,TemporalUnit)}.
This instance is immutable and unaffected by this method call. @param amount the amount to subtract, not null @return a {@code ZonedDateTime} based on this date-time with the subtraction made, not null @throws DateTimeException if the subtraction cannot be made @throws ArithmeticException if numeric overflow occurs
Note that calling {@code plus} followed by {@code minus} is not guaranteed toreturn the same date-time.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|