in Education by

How will you get the instant of local date time using time in of milliseconds using java8 in Java8?

Please log in or register to answer this question.

1 Answer

0 votes
by

How will you get the instant of local date time using time in of milliseconds using java8 in Java8?

Following code gets the instant of local date time using time in of milliseconds -

Instant now = currentDate.toInstant();

ZoneId currentZone = ZoneId.systemDefault();

LocalDateTime localDateTime = LocalDateTime.ofInstant(now, currentZone);

System.out.println("Local date: " + localDateTime);

Related questions

0 votes
asked Nov 8, 2020 in Education by Editorial Staff
0 votes
asked Nov 8, 2020 in Education by Editorial Staff
0 votes
asked Nov 8, 2020 in Education by Editorial Staff
...