LocalDate today = LocalDate.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/mm/yyyy");
String hojeformatado = formatter.format(today);
System.out.println(hojeformatado);
Exception in thread "main" java.time.temporal.UnsupportedTemporalTypeException: Unsupported field: MinuteOfHour at java.time.LocalDate.get0(Unknown Source) at java.time.LocalDate.getLong(Unknown Source) at java.time.format.DateTimePrintContext.getValue(Unknown Source) at java.time.format.DateTimeFormatterBuilder$NumberPrinterParser.format(Unknown Source) at java.time.format.DateTimeFormatterBuilder$CompositePrinterParser.format(Unknown Source) at java.time.format.DateTimeFormatter.formatTo(Unknown Source) at java.time.format.DateTimeFormatter.format(Unknown Source) at ILearn.Datas.main(Datas.java:41)