|
@@ -21,8 +21,8 @@ public class DateUtil {
|
|
|
public static String DATE_FORMAT_CHINESE = "yyyy年M月d日";
|
|
|
|
|
|
public static String DateFormatToyyyyMMdd(LocalDateTime dt) {
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_CHINESE);
|
|
|
- return sdf.format(dt);
|
|
|
+ DateTimeFormatter dtf2 = DateTimeFormatter.ofPattern(DATE_FORMAT_CHINESE);
|
|
|
+ return dtf2.format(dt);
|
|
|
}
|
|
|
|
|
|
// String times = "2016-11-18 00:00:00";
|
|
@@ -644,7 +644,7 @@ public class DateUtil {
|
|
|
public static void main(String[] args) throws ParseException {
|
|
|
// Date nextMonthLastDay = nextMonthFirstDate();
|
|
|
// System.out.println(nextMonthLastDay);
|
|
|
- System.out.println(LocalDate.now().plusDays(-1).atStartOfDay());
|
|
|
+ System.out.println(DateFormatToyyyyMMdd(LocalDateTime.now()));
|
|
|
}
|
|
|
|
|
|
// public static void main(String[] args) {
|