0
public String getDate() throws ParseException{
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("LL dd, yyyy");
LocalDate date = getPublishDate().toInstant().atZone(ZoneId.of("Europe/Kiev")).toLocalDate();
System.out.println(date);
String text = date.format(formatter);
System.out.println(text);
return text;
}
出力:変換月数
2016-10-01
10 01, 2016
私はテキスト表示で月を印刷したい:10月1日、2016年
getPublishDate
- プライベートフィールドDate publishDate
のゲッター。
感謝を!あなたのソリューションは私を助けました! – DenysM