Fetching UNIX epoch time in java
<p>I was trying to fetch the current time in UTC in Java and came across this post: <a href="https://stackoverflow.com/questions/732034/getting-unixtime-in-java">Getting &quot;unixtime&quot; in Java</a></p>

<p>I checked out that all solutions</p>

<ol>
<li><code>new Date().getTime()</code></li>
<li><code>System.currentTimeMillis()</code></li>
<li><code>Instant.now().toEpochMillis()</code></li>
</ol>

<p>return the same value. I wished to know if there is any difference between the three of them. If so then what?</p>