O GoConqr está de visual novo! Conte para nós o que você achou.

Módulo 2 de 5 · Texto

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.

Instruções

Para avançar no curso, envie uma tentativa deste quiz. Você pode enviá-la depois da última pergunta.

Ir para o módulo escolhido

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?