0 votes
14 views

How will you add 1 week to current date using local datetime api of java8 in Java8?

in Education by (51.6k points)

1 Answer

0 votes

How will you add 1 week to current date using local datetime api of java8 in Java8?

Following code adds 1 week to current date using local datetime api -

//add 1 week to the current date

LocalDate today = LocalDate.now();

LocalDate nextWeek = today.plus(1, ChronoUnit.WEEKS);

System.out.println("Next week: " + nextWeek);

by (51.6k points)

Related questions

0 votes
1 answer 10 views
10 views asked Nov 8, 2020 in Education by Editorial Staff (51.6k points)
0 votes
1 answer 12 views
0 votes
1 answer 10 views
0 votes
1 answer 12 views
12 views asked Nov 8, 2020 in Education by Editorial Staff (51.6k points)
0 votes
1 answer 12 views
0 votes
1 answer 10 views
0 votes
1 answer 21 views
0 votes
1 answer 12 views
0 votes
1 answer 18 views
0 votes
1 answer 8 views
...