浏览代码

Merge branch 'dev' of http://47.102.110.240:3000/18516779956/jz_crm_service.git into dev

lurunzhen 3 年之前
父节点
当前提交
4b4748b790
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      jz-crm-hm-api/src/main/java/org/linlinjava/jz/hm/util/DateUtil.java

+ 3 - 3
jz-crm-hm-api/src/main/java/org/linlinjava/jz/hm/util/DateUtil.java

@@ -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) {