// en-GB inherits from en-001 where its short tz name for // America/Los_Angeles is "non-inheritance marker". Thus the // resulting formatted text should be a custom ID.
DateTimeFormatterBuilder dtfb = new DateTimeFormatterBuilder();
dtfb.appendZoneText(TextStyle.SHORT);
DateTimeFormatter dtf = dtfb.toFormatter(Locale.UK)
.withZone(ZoneId.of("America/Los_Angeles"));
String result = dtf.format(d);
System.out.println(result); if (!"GMT-08:00".equals(result)) { thrownew RuntimeException("short time zone name for America/Los_Angeles in en_GB is incorrect. Got: " + result + ", expected: GMT-08:00");
}
// Islamic Um-Alqura calendar is an alias to Islamic calendar. // In Islamic calendar data, only month names are localized, also // date/time format for FULL style should be inherited from "generic" // calendar, where it includes ERA field.
Locale locale = Locale.forLanguageTag("en-US-u-ca-islamic-umalqura");
Chronology chrono = Chronology.ofLocale(locale);
dtf = DateTimeFormatter
.ofLocalizedDate(FormatStyle.FULL)
.withLocale(locale)
.withChronology(chrono);
result = dtf.format(d);
System.out.println(dtf.format(d)); if (!"Tuesday, Safar 12, 1400 AH".equals(result)) { thrownew RuntimeException("FULL date format of Islamic Um-Alqura calendar in en_US is incorrect. Got: " + result + ", expected: Tuesday, Safar 12, 1400 AH");
}
}
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet am 2026-06-10)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.