I am wondering if there is a way to get current milliseconds since 1-1-1970 (epoch) using the new LocalDate
, LocalTime
or LocalDateTime
classes of Java 8.
The known way is below:
long currentMilliseconds = new Date().getTime();
or
long currentMilliseconds = System.currentTimeMillis();