diff --git a/Calendar-API.md b/Calendar-API.md index c9a1710..8c1a3d2 100644 --- a/Calendar-API.md +++ b/Calendar-API.md @@ -2,9 +2,9 @@ Drei verschiedene Klassen für Datum, Zeit und Datum mit Zeit. ``` -LocalDate date = LocalDate.of(2020, Month.APRIL, 14); -LocalTime time = LocalTime.of(12, 45); -LocalDateTime dateTime = LocalDateTime.of(date, time); +LocalDate date = LocalDate.of(2020, Month.APRIL, 14); // Datum ohne Uhrzeit +LocalTime time = LocalTime.of(12, 45); // Uhrzeit ohne Datum +LocalDateTime dateTime = LocalDateTime.of(date, time); // Datum mit Uhrzeit ``` ## Wichtige Eigenschaften @@ -14,4 +14,7 @@ LocalDateTime dateTime = LocalDateTime.of(date, time); ## Formatierte Ausgabe - Formatierung per `DateTimeFormatter` - Erzeugung per Factory (`DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofLocalizedDate(FormatStyle.MEDIUM)` +- Formatierte Ausgebe: `dateTimeFormatter.format(date)` + - Ein Formatter für alle Typen + - **Vorsicht**: Bei Verwendung unbekannter Felder `UnsupportedTemporalTypeException`