GoConqr has a new look! Let us know what you think.

Module 4 of 5 · Text

Date and time manipulation

Brenda Gabriela Senra da Silva

✅ plusDays()

Adds days to a date.

LocalDate newDate = date.plusDays(10);

👉 Adds 10 days.

✅ plusWeeks()

Adds weeks to a date.

LocalDate newDate = date.plusWeeks(2);

👉 Adds 2 weeks (14 days).

✅ plusMonths()

Adds months to a date.

LocalDate newDate = date.plusMonths(3);

👉 Adds 3 months.

⚠ Important:
If the day does not exist in the new month, Java adjusts automatically.

Example:

LocalDate.of(2026, 1, 31).plusMonths(1);

Result → 2026-02-28

✅ plusYears()

Adds years to a date.

LocalDate newDate = date.plusYears(1);

👉 Adds 1 year.

Instructions

You must submit an attempt for this quiz to progress. You can submit it after the last question.

Go to the chosen module

Feedback

What is it about?

What do you think of the new look?

How do you like it?