java.time.Instant.with(TemporalField field, long newValue)


java.time.Instant.with(TemporalField field, long newValue)

package com.codingdict;

import java.time.Instant;
import java.time.temporal.ChronoField;

public class InstantDemo {
   public static void main(String[] args) {

      Instant instant = Instant.parse("2017-12-03T10:15:30.00Z");
      System.out.println(instant.with(ChronoField.NANO_OF_SECOND, 20));
   }
}