やり方
String now_1_ = DateTimeFormatter.ofPattern("yyyy/MM/dd_HH:mm:ss.SSS").format(LocalDateTime.now());
System.out.println(now_1_);
String now_2_ = DateTimeFormatter.ofPattern("yyyy年MM月dd日(E曜日) HH時mm分ss秒SSS").format(LocalDateTime.now());
System.out.println(now_2_);
参考サイトさん
実行結果
バージョン
Microsoft Windows [Version 10.0.19045.4170]
JAVA 17.0.8.1