0 votes
10 views

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

in Education by (49.4k points)

1 Answer

0 votes

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);

by (49.4k points)

Related questions

0 votes
1 answer 12 views
0 votes
1 answer 10 views
0 votes
1 answer 16 views
0 votes
1 answer 12 views
0 votes
1 answer 10 views
0 votes
1 answer 11 views
0 votes
1 answer 21 views
0 votes
1 answer 12 views
0 votes
1 answer 7 views
0 votes
1 answer 13 views
...