nutze DateTimeFormatter

This commit is contained in:
Marc Koch 2020-04-20 15:00:18 +02:00
parent e8e035d566
commit eeb1a8e5f1
1 changed files with 3 additions and 2 deletions

View File

@ -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;