Commit 85d6370e authored by 黎博's avatar 黎博

调试

parent 0a15e431
...@@ -363,13 +363,14 @@ public class K8sService { ...@@ -363,13 +363,14 @@ public class K8sService {
// podMap.put("startTime", pod.getStatus().getStartTime()); // podMap.put("startTime", pod.getStatus().getStartTime());
// 特殊处理,格式化创建时间 // 特殊处理,格式化创建时间
try { try {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
df.setTimeZone(TimeZone.getTimeZone("UTC"));
if (pod.getStatus().getStartTime() != null) { if (pod.getStatus().getStartTime() != null) {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
df.setTimeZone(TimeZone.getTimeZone("UTC"));
podMap.put("createdAt", df.parse(pod.getStatus().getStartTime())); podMap.put("createdAt", df.parse(pod.getStatus().getStartTime()));
} else { } else {
SimpleDateFormat df2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
log.info("pod.getStatus().getStartTime()为null"); log.info("pod.getStatus().getStartTime()为null");
podMap.put("createdAt", df.format(new Date())); podMap.put("createdAt", df2.format(new Date()));
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment