The
minusSeconds() method of OffsetTime class in Java returns a copy of this OffsetTime with the specified Seconds in the parameter getting subtracted.
Syntax :
public OffsetTime minusSeconds(long Seconds)
Parameter: This method accepts a single parameter
Seconds which the Seconds to be subtracted. It may be negative.
Return Value: It returns a OffsetTime based on this time with the Seconds subtracted and it is not null.
Below programs illustrate the minusSeconds() method:
Program 1 :
Output:
After subtraction, time is: 11:10:05+05:05
Program 2 :