package com.logicbig.example.offsettime;
import java.time.OffsetTime;
public class PlusHoursExample {
public static void main(String... args) {
OffsetTime t = OffsetTime.now();
System.out.println(t);
OffsetTime t2 = t.plusHours(10);
System.out.println(t2);
OffsetTime t3 = t.plusHours(5000);
System.out.println(t3);
}
}
Output
16:13:24.508-05:00
02:13:24.508-05:00
00:13:24.508-05:00
package com.logicbig.example.offsettime;
import java.time.OffsetTime;
public class PlusHoursExample2 {
public static void main(String... args) {
OffsetTime t = OffsetTime.now();
System.out.println(t);
OffsetTime t2 = t.plusHours(-10);
System.out.println(t2);
OffsetTime t3 = t.plusHours(-5000);
System.out.println(t3);
}
}
Output
16:13:26.576-05:00
06:13:26.576-05:00
08:13:26.576-05:00