Skip to main content
2 of 2
added 55 characters in body
Marteng
  • 1.3k
  • 1
  • 15
  • 33

Since Java 8 you can call java.time.Instant.toEpochMilli().

For example the call

final long currentTimeJava8 = Instant.now().toEpochMilli(); 

gives you the same results as

final long currentTimeJava1 = System.currentTimeMillis(); 
Marteng
  • 1.3k
  • 1
  • 15
  • 33