首页数据改正

This commit is contained in:
liuyingfang
2024-04-18 11:44:11 +08:00
parent ed5c27c37e
commit 19ff867dee
5 changed files with 149 additions and 27 deletions

View File

@@ -44,6 +44,19 @@ public class DateUtil {
return localDateTime.atZone(ZoneId.systemDefault()).toEpochSecond();
}
/**
* 将Date对象转换为时间戳毫秒
* @param date 要转换的Date对象
* @return 转换后的时间戳(毫秒)
*/
public static long convertDateToTimestamp(Date date) {
if (date == null) {
throw new IllegalArgumentException("Date cannot be null");
}
return date.getTime();
}
/**
* 时间戳转LocalDateTime
*