LocalTime minus(TemporalAmount amountToSubtract) example
Description
LocalTime minus(TemporalAmount amountToSubtract)
returns a copy
of this time with the specified amount subtracted.
Syntax
minus
has the following syntax.
public LocalTime minus(TemporalAmount amountToSubtract)
Example
The following example shows how to use minus
.
import java.time.LocalTime;
import java.time.Period;
/* w ww . j av a 2s.co m*/
public class Main {
public static void main(String[] args) {
LocalTime l = LocalTime.now();
LocalTime s = l.minus(Period.ofDays(1));
System.out.println(s);
}
}