import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;
import java.util.Locale;
public class Main {
public static void main
(String[] args
) { DateTimeFormatter dtfInput
= DateTimeFormatter.
ofPattern("uuuuMMdd",
Locale.
ENGLISH);
// A sample date string
LocalDate date = LocalDate.parse(strDate, dtfInput);
System.
out.
println(date.
format(getShortDateFormatterForLocale
(Locale.
getDefault()))); System.
out.
println(date.
format(getShortDateFormatterForLocale
(Locale.
GERMANY))); System.
out.
println(date.
format(getShortDateFormatterForLocale
(Locale.
US))); }
static DateTimeFormatter getShortDateFormatterForLocale
(Locale locale
) { return DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT).localizedBy(locale);
}
}
aW1wb3J0IGphdmEudGltZS5Mb2NhbERhdGU7CmltcG9ydCBqYXZhLnRpbWUuZm9ybWF0LkRhdGVUaW1lRm9ybWF0dGVyOwppbXBvcnQgamF2YS50aW1lLmZvcm1hdC5Gb3JtYXRTdHlsZTsKaW1wb3J0IGphdmEudXRpbC5Mb2NhbGU7CgpwdWJsaWMgY2xhc3MgTWFpbiB7CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB7CgkJRGF0ZVRpbWVGb3JtYXR0ZXIgZHRmSW5wdXQgPSBEYXRlVGltZUZvcm1hdHRlci5vZlBhdHRlcm4oInV1dXVNTWRkIiwgTG9jYWxlLkVOR0xJU0gpOwoKCQkvLyBBIHNhbXBsZSBkYXRlIHN0cmluZwoJCVN0cmluZyBzdHJEYXRlID0gIjIwMjEwNjMwIjsKCQlMb2NhbERhdGUgZGF0ZSA9IExvY2FsRGF0ZS5wYXJzZShzdHJEYXRlLCBkdGZJbnB1dCk7CgoJCVN5c3RlbS5vdXQucHJpbnRsbihkYXRlLmZvcm1hdChnZXRTaG9ydERhdGVGb3JtYXR0ZXJGb3JMb2NhbGUoTG9jYWxlLmdldERlZmF1bHQoKSkpKTsKCQlTeXN0ZW0ub3V0LnByaW50bG4oZGF0ZS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