Returns a copy of this OffsetTime with the specified number of hours subtracted.
package com.logicbig.example.offsettime;
import java.time.OffsetTime;
public class MinusHoursExample {
public static void main(String... args) {
OffsetTime t = OffsetTime.now();
System.out.println(t);
OffsetTime t2 = t.minusHours(5);
System.out.println(t2);
OffsetTime t3 = t.minusHours(500);
System.out.println(t3);
}
}
Output
16:14:04.350-05:00
11:14:04.350-05:00
20:14:04.350-05:00
package com.logicbig.example.offsettime;
import java.time.OffsetTime;
public class MinusHoursExample2 {
public static void main(String... args) {
OffsetTime t = OffsetTime.now();
System.out.println(t);
OffsetTime t2 = t.minusHours(-5);
System.out.println(t2);
OffsetTime t3 = t.minusHours(-500);
System.out.println(t3);
}
}
Output
16:14:06.448-05:00
21:14:06.448-05:00
12:14:06.448-05:00