dateToLocalDate/localDateToDate
/**
* date转 localdate
*
* @param date
* @return
*/
private static LocalDate dateToLocalDate(Date date) {
logger.info("date转 localdate" + date);
if (null == date) {
return null;
}
return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
}
/**
* localdate 转 date
*
* @param localDate
* @return
*/
private static Date localDateToDate(LocalDate localDate) {
logger.info(" localdate 转 date" + localDate);
if (null == localDate) {
return null;
}
ZonedDateTime zonedDateTime = localDate.atStartOfDay(ZoneId.systemDefault());
return Date.from(zonedDateTime.toInstant());
}
不恋尘世浮华,不写红尘纷扰