Skip to content

Commit

Permalink
Fixed the assign value to the latestCommitTime:
Browse files Browse the repository at this point in the history
Replaced the method Instant.ofEpochMilli() with the method
Instant.ofEpochSecond() because RevCommit.getCommitTime()
return the number of the seconds from epoch.

(cherry picked from commit 47cbf6e)
  • Loading branch information
amusarra committed Dec 14, 2024
1 parent deb9b6e commit a717b30
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void gitInfo(InfoBuildTimeConfig config,
Map<String, Object> commit = new LinkedHashMap<>();
String latestCommitId = latestCommit.getName();
commit.put("id", latestCommitId);
String latestCommitTime = formatDate(Instant.ofEpochMilli(latestCommit.getCommitTime()), ZoneId.systemDefault());
String latestCommitTime = formatDate(Instant.ofEpochSecond(latestCommit.getCommitTime()), ZoneId.systemDefault());
commit.put("time", latestCommitTime);

if (addFullInfo) {
Expand Down

0 comments on commit a717b30

Please sign in to comment.