Java 8 Instant.now() with nanosecond resolution?
问题 Java 8\'s java.time.Instant stores in \"nanosecond resolution\", but using Instant.now() only provides millisecond resolution... Instant instant = Instant.now(); System.out.println(instant); System.out.println(instant.getNano()); Result... 2013-12-19T18:22:39.639Z 639000000 How can I get an Instant whose value is \'now\', but with nanosecond resolution? 回答1: While default Java8 clock does not provide nanoseconds resolution, you can combine it with Java ability to measure time differences with