diff --git a/src/geburtstag/Geburtstag.java b/src/geburtstag/Geburtstag.java index 6a2e195..4e9ccb5 100644 --- a/src/geburtstag/Geburtstag.java +++ b/src/geburtstag/Geburtstag.java @@ -9,6 +9,8 @@ hier bitte die notwendigen imports ergänzen! import java.sql.SQLOutput; import java.time.DateTimeException; import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.FormatStyle; import java.util.Arrays; import java.util.HashMap; import java.util.Scanner; @@ -44,8 +46,7 @@ public class Geburtstag { jetzt = LocalDateTime.now(); System.out.println("Jetzt ist:"); - System.out.println(jetzt.getDayOfMonth() + "." + jetzt.getMonthValue() + "." + jetzt.getYear() + - ", " + jetzt.getHour() + ":" + jetzt.getMinute()); + System.out.println(jetzt.format(DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM))); System.out.println(); int tageBisGeburtstag = 0;