Returns a copy of this LocalDateTime with the specified number of hours subtracted, adjusting other fields if necessary.
package com.logicbig.example.localdatetime;
import java.time.LocalDateTime;
public class MinusHoursExample {
public static void main (String... args) {
LocalDateTime d = LocalDateTime.of(2016, 11, 12,
12, 30, 15);
LocalDateTime d2 = d.minusHours(200);
System.out.println(d2);
d2 = d.minusHours(-200);
System.out.println(d2);
}
}
Output
2016-11-04T04:30:15
2016-11-20T20:30:15