Returns a copy of this OffsetTime with nano-of-second replaced with the provided 'nanoOfSecond'.
package com.logicbig.example.offsettime;
import java.time.OffsetTime;
public class WithNanoExample {
public static void main(String... args) {
OffsetTime t = OffsetTime.now();
System.out.println(t);
OffsetTime t2 = t.withNano(100);
System.out.println(t2);
}
}
Output
16:12:48.913-05:00
16:12:48.000000100-05:00