Commit 26063a25 authored by 黎博's avatar 黎博

服务时间格式化

parent ffc1f8fe
......@@ -169,7 +169,15 @@ public class K8sService {
map.put("portMappings", portMappingList);
}
}
map.put("createdAt", podMetadata.getCreationTimestamp());
try {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
df.setTimeZone(TimeZone.getTimeZone("UTC"));
map.put("createdAt", df.parse(podMetadata.getCreationTimestamp()));
} catch (Exception e) {
e.printStackTrace();
log.info("时间转换异常!");
map.put("createdAt", podMetadata.getCreationTimestamp());
}
map.put("serviceName", serviceName);
map.put("podName", podMetadata.getName());
map.put("labels", podMetadata.getLabels());
......
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