title: How to get current time in nano seconds in java?
body: <p>I do lots of research but did not find any good answer. 
  I wanted to get the current date and time in a nanosecond.
  I found that <code>System.nanoTime()</code> will provide nanoseconds, but that is and system elapsed time. means it will provide a time when system up. I need to use the current date and time in a nanosecond. </p>
  
  <p>I need this for avoiding duplicate of points in InfluxDB, see <a href="https://docs.influxdata.com/influxdb/v1.3/troubleshooting/frequently-asked-questions/#how-does-influxdb-handle-duplicate-points" rel="nofollow noreferrer">How does InfluxDB handle duplicate points?</a> So when I use millisecond I am facing issues of data union. So need deciding to go with nanosecond but the problem is while generated nano the second using <code>System.nanoTime()</code> did not contain current date and time data. and it give me JVM uptime which is useless for me.</p>