List of usage examples for java.time Duration withNanos
public Duration withNanos(int nanoOfSecond)
From source file:Main.java
public static void main(String[] args) { Duration duration = Duration.between(LocalTime.MIDNIGHT, LocalTime.NOON); duration = duration.withNanos(1000); System.out.println(duration.getNano()); }