GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Modul 2 von 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.

Anleitung

Um im Kurs weiterzukommen, sende einen Versuch dieses Quiz ab. Du kannst ihn nach der letzten Frage absenden.

Zum gewählten Modul

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck