LocalTime minusHours(long hoursToSubtract) example
Description
LocalTime minusHours(long hoursToSubtract)
returns a
copy of this LocalTime with the specified period in hours subtracted.
Syntax
minusHours
has the following syntax.
public LocalTime minusHours(long hoursToSubtract)
Example
The following example shows how to use minusHours
.
import java.time.LocalTime;
// w ww. j av a 2 s .c o m
public class Main {
public static void main(String[] args) {
LocalTime l = LocalTime.now();
LocalTime s = l.minusHours(1);
System.out.println(s);
}
}
The code above generates the following result.