diff --git a/sentinel-core/src/main/java/com/alibaba/csp/sentinel/node/metric/MetricNode.java b/sentinel-core/src/main/java/com/alibaba/csp/sentinel/node/metric/MetricNode.java index 0e15dbb1bd..3f234365b6 100755 --- a/sentinel-core/src/main/java/com/alibaba/csp/sentinel/node/metric/MetricNode.java +++ b/sentinel-core/src/main/java/com/alibaba/csp/sentinel/node/metric/MetricNode.java @@ -213,7 +213,7 @@ public static MetricNode fromThinString(String line) { */ private static DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); - + public String toFatString() { StringBuilder sb = new StringBuilder(32); sb.delete(0, sb.length()); @@ -222,7 +222,7 @@ public String toFatString() { sb.append(timestamp).append("|"); LocalDateTime dateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(timestamp), ZoneId.systemDefault()); - sb.append(dateTime.format(df)).append("|"); + sb.append(df.format(dateTime)).append("|"); String legalName = getResource().replaceAll("\\|", "_"); sb.append(legalName).append("|");