From 2503c6eba135ddbfb5d4e9eb8e57ab6c41eab5f0 Mon Sep 17 00:00:00 2001 From: longjuan <769022681@qq.com> Date: Mon, 18 Mar 2024 09:44:08 +0800 Subject: [PATCH] fix: Correct the formatting of Milliseconds to be a 3-digit number (#126) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ```release-note 修复重命名模板中 millisecond 没有被格式化3位数的问题 ``` --- src/main/java/run/halo/s3os/PlaceholderReplacer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/run/halo/s3os/PlaceholderReplacer.java b/src/main/java/run/halo/s3os/PlaceholderReplacer.java index 87e502a..45bac02 100644 --- a/src/main/java/run/halo/s3os/PlaceholderReplacer.java +++ b/src/main/java/run/halo/s3os/PlaceholderReplacer.java @@ -69,7 +69,7 @@ private static String generateRandomNumber(String[] placeholderParams) { private static String currentMillisecond(Map reusableParams) { LocalDateTime time = LocalDateTime.parse(reusableParams.get("time")); - return String.valueOf(time.getNano() / 1000000); + return String.format("%03d", time.getNano() / 1000000); } private static String currentSecond(Map reusableParams) {