[bugfix]修复云端录像查询时间转换错误的问题
This commit is contained in:
@@ -106,6 +106,26 @@ public class DateUtil {
|
||||
return formatter.format(LocalDateTime.ofInstant(instant, ZoneId.of(zoneStr)));
|
||||
}
|
||||
|
||||
/**
|
||||
* yyyy_MM_dd_HH_mm_ss 转时间戳(毫秒)
|
||||
*
|
||||
* @param formatTime
|
||||
* @return
|
||||
*/
|
||||
public static long yyyy_MM_dd_HH_mm_ssToTimestampMs(String formatTime) {
|
||||
TemporalAccessor temporalAccessor = formatter.parse(formatTime);
|
||||
Instant instant = Instant.from(temporalAccessor);
|
||||
return instant.toEpochMilli();
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间戳(毫秒) 转 yyyy_MM_dd_HH_mm_ss
|
||||
*/
|
||||
public static String timestampMsTo_yyyy_MM_dd_HH_mm_ss(long timestamp) {
|
||||
Instant instant = Instant.ofEpochMilli(timestamp);
|
||||
return formatter.format(LocalDateTime.ofInstant(instant, ZoneId.of(zoneStr)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间戳 转 yyyy_MM_dd
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user