How can I print Java Instant
as a timestamp with fractional seconds like 1558766955.037 ? The precision needed is to 1/1000, as the example shows.
I tried (double) timestamp.getEpochSecond() + (double) timestamp.getNano() / 1000_000_000
, but when I convert it to string and print it, it shows 1.558766955037E9
.