Вот что я сделал до сих пор:
Код: Выделить всё
public static String formatDateByLocale(String date, String languageTag) {
Locale locale = Locale.forLanguageTag(languageTag);
String datePattern = DateTimeFormatterBuilder.getLocalizedDateTimePattern(FormatStyle.LONG, FormatStyle.LONG, Chronology.ofLocale(locale), locale);
DateTimeFormatter targetFormat = DateTimeFormatter.ofPattern(datePattern).withLocale(locale);
DateTimeFormatter currentFormat = DateTimeFormatter.ofPattern("dd/MM/yyyy hh:mm a");
LocalDateTime localDateTime = LocalDateTime.parse(date, currentFormat);
String result = targetFormat.format(localDateTime);
return result;
}
Как мне подойти к этому, чтобы дата 17.04.2017 10:50 с тегом FR преобразовалась в 2017/04/17 10:50?»
Подробнее здесь: https://stackoverflow.com/questions/474 ... -java-time
Мобильная версия