As Java 11 is released, we got it and tried to print Instant.now(). Our requirement is to give the time string in nanosecond precision.
We are spiking on AWS with centos7, we verified that system clock has precision upto nanos by firing
$ date +"%s %9N"
1537941601 130559008
But while printing Instant.now() with following formatter
DateTimeFormatter.ISO_INSTANT.withZone(ZoneOffset.UTC).format(instant)
It gives
2018-09-26T05:57:18.390390Z
and with following formatter
DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss[.SSSSSSSSS]").withZone(ZoneOffset.UTC)
it gives
2018-09-26T06:07:38.296302000
So, is that fair to say that support for nano precision is not present in java 11?