LocalTime minusHours(long hoursToSubtract)
returns a
copy of this LocalTime with the specified period in hours subtracted.
minusHours
has the following syntax.
public LocalTime minusHours(long hoursToSubtract)
The following example shows how to use minusHours
.
import java.time.LocalTime; 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.