我正在使用:
Locale locale = Locale.FRENCH;
DateTimeFormatter formatter = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.FULL).withLocale(locale).withZone(zone);
System.out.println(formatter.format(Instant.now()));
我得到的结果是带有lundi 25 mai 2020 20 h 21 CEST
的Locale.FRENCH
和带有Monday, May 25, 2020 8:05:11 PM CEST
的Locale.English
我发现CEST
对非IT人员不友好,如何可靠地将其删除?
您可以自定义要显示的内容和不显示的内容例如DateTimeFormatter.ofPattern("EEEE, MMMM dd, yyyy hh:mm:ss a")
给出lundi, mai 25, 2020 07:02:57 PM