Java Date Time Java Java API
java.time.OffsetTime
public OffsetTime withNano(int nanoOfSecond)
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); }}
16:12:48.913-05:0016:12:48.000000100-05:00