Skip to content

Commit

Permalink
fix: Correct the formatting of Milliseconds to be a 3-digit number (#126
Browse files Browse the repository at this point in the history
)

```release-note
修复重命名模板中 millisecond 没有被格式化3位数的问题
```
  • Loading branch information
longjuan committed Mar 18, 2024
1 parent 84aa7d3 commit 2503c6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/run/halo/s3os/PlaceholderReplacer.java
Expand Up @@ -69,7 +69,7 @@ private static String generateRandomNumber(String[] placeholderParams) {

private static String currentMillisecond(Map<String, String> 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<String, String> reusableParams) {
Expand Down

0 comments on commit 2503c6e

Please sign in to comment.