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

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

For example the call

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

which gives you the same results as

final long currentTimeJava1 = System.currentTimeMillis(); 

Since Java 8 you can use

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

which gives you the same results as

final long currentTimeJava1 = System.currentTimeMillis(); 

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(); 
Source Link
Marteng
  • 1.3k
  • 1
  • 15
  • 33

Since Java 8 you can use

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

which gives you the same results as

final long currentTimeJava1 = System.currentTimeMillis();