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

Module 2 of 5 · Text

Calculation of the difference between dates

Brenda Gabriela Senra da Silva

🧠 Super resumo mental

Duration → small units (hours/minutes)
Period → big units (years/months/days)

✅ Duration

Duration measures time in:

  • hours

  • minutes

  • seconds

It is used with:

  • LocalTime

  • LocalDateTime

👉 Think of Duration as clock-based time.

Example:

Duration.between(start, end);

It calculates how much time passed between two times.

 

✅ Period

Period measures time in:

  • years

  • months

  • days

It is used with:

  • LocalDate

👉 Think of Period as calendar-based time.

Example:

Period.between(startDate, endDate);

It calculates the difference in years, months, and days.

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?