修改pc已读消息列表
This commit is contained in:
@@ -18,6 +18,9 @@ import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
*/
|
||||
public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
{
|
||||
// 固定东八区时区
|
||||
private static final ZoneId ZONE_ID = ZoneId.of("Asia/Shanghai");
|
||||
|
||||
public static String YYYY = "yyyy";
|
||||
|
||||
public static String YYYY_MM = "yyyy-MM";
|
||||
@@ -188,4 +191,16 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
||||
ZonedDateTime zdt = localDateTime.atZone(ZoneId.systemDefault());
|
||||
return Date.from(zdt.toInstant());
|
||||
}
|
||||
|
||||
/**
|
||||
* Date 转 LocalDateTime(东八区)
|
||||
*/
|
||||
public static LocalDateTime dateToLocalDateTime(Date date) {
|
||||
if (date == null) {
|
||||
date=new Date();
|
||||
}
|
||||
return date.toInstant()
|
||||
.atZone(ZONE_ID)
|
||||
.toLocalDateTime();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user