Skip to content

Instantly share code, notes, and snippets.

@robsongomes
Created September 12, 2015 14:46
Show Gist options
  • Save robsongomes/a147af5f4c92f89a2c47 to your computer and use it in GitHub Desktop.
Save robsongomes/a147af5f4c92f89a2c47 to your computer and use it in GitHub Desktop.
import java.time.LocalDate;
import java.time.Month;
public class LocalDateTeste {
public static void main(String[] args) {
LocalDate agora = LocalDate.now();
System.out.println(agora);
//Exibe a data atual no formato YYYY-MM-DD
LocalDate dataNascimento = LocalDate.of(1984, Month.MAY, 11);
System.out.println(dataNascimento);
//Exibe a data fornecida no formato YYYY-MM-DD
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment