Java Date Time Java Java API
java.time.OffsetDateTime
public int getNano()
Returns the nano-of-second field from this OffsetDateTime instance.
package com.logicbig.example.offsetdatetime;import java.time.LocalDateTime;import java.time.OffsetDateTime;import java.time.ZoneOffset;public class GetNanoExample { public static void main (String... args) { OffsetDateTime d = OffsetDateTime.of(LocalDateTime.of(2010, 10, 3, 11, 43, 30, 1000), ZoneOffset.ofHours(-5)); int nano = d.getNano(); System.out.println(nano); }}
1000