LocalDateTime
LocalDateTime ldt = LocalDateTime.now();
LocalDateTime todayZero = LocalDateTime.of(ldt.getYear(), ldt.getMonthValue(), ldt.getDayOfMonth(), 0, 0, 0);
DateTimeFormatter
DateTimeFormatter DATE_ZERO_FORMAT = DateTimeFormatter.ofPattern("yyyyMMdd");
LocalDateTime ldt = LocalDateTime.now();
String todayZeroStr = ldt.format(DelegateActiveComp.DATE_ZERO_FORMAT);
SimpleDateFormat
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Date activationTime = dateFormat.parse(dateFormat.format(new Date()));
标签:JAVA,dateFormat,LocalDateTime,当天,SimpleDateFormat,日期,DateTimeFormatter,ldt,FORMA
From: https://www.cnblogs.com/bigjor/p/17896324.html