调试修改海康访客-1
This commit is contained in:
1 parent
82fe8afa3e
commit
2ac305e479
14 files changed
+265
-23
No files matched your search
+20
@@ -0,0 +1,20 @@
|
||||
package com.bsd.pjcloud.common.core.util;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
public class TimeUtils {
|
||||
|
||||
public static String LocalDateTimeToISO8601(LocalDateTime localDateTime) {
|
||||
|
||||
// 2. 附加时区信息(如北京时间 UTC+8)
|
||||
ZoneId zone = ZoneId.of("Asia/Shanghai");
|
||||
ZonedDateTime zonedDateTime = localDateTime.atZone(zone);
|
||||
|
||||
// 3. 格式化为 ISO 8601
|
||||
String isoTime = zonedDateTime.format(DateTimeFormatter.ISO_OFFSET_DATE_TIME);
|
||||
return isoTime;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user