标签:ati rom cal eid oda static local @param datetime
/**
* 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());
}
dateToLocalDate/localDateToDate
标签:ati rom cal eid oda static local @param datetime
原文地址:https://www.cnblogs.com/xiaoshahai/p/13813289.html