首页数据改正
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user