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

Módulo 3 de 5 · Texto

Assigning values

Brenda Gabriela Senra da Silva

 now(ZoneId) → quando quer hora de outro país

now(ZoneId) → when you want the time of another country

.now()

Gets the current date or time from the system.

.of()

Creates a date/time by passing numbers.

.parse()

Converts a String into a date/time object

 

✅ .now() → when you need the current moment

You use it when the system needs to know:

  • today’s date

  • the current time

  • the exact moment of a purchase

  • whether something is overdue

Real examples:

LocalDate today = LocalDate.now();
LocalDateTime purchaseMoment = LocalDateTime.now();

 

📌 Commonly used in:

  • payment systems

  • due date verification

  • logging systems

 

✅ .of() → when you already know the values

You use it when:

  • you are creating a fixed date

  • you are testing your code

  • you are defining a specific rule

LocalDate dueDate = LocalDate.of(2026, 5, 15);

 

📌 Commonly used in:

  • unit tests

  • system-defined dates

  • calculated or predefined dates

 

                                                                                      ✅ .parse() → when the date comes as TEXT

You use it when:

  • you receive a date from the user

  • you receive a date from a database

  • you receive a date from an API

  • you read a date from a file

 

Example:

LocalDate date = LocalDate.parse("2026-05-15");

📌 Commonly used in:

  • forms

  • system integration

  • JSON data processing

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?