Skip to content

Commit

Permalink
fix: date parsing after 8.0.0 release of git-commit-id (#2286)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Laprun <[email protected]>
  • Loading branch information
metacosm authored Mar 13, 2024
1 parent 0029b67 commit 9674154
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.text.SimpleDateFormat;
import java.time.Instant;
import java.util.Arrays;
import java.util.Date;
Expand Down Expand Up @@ -57,9 +56,7 @@ public static Version loadFromProperties() {
try {
String time = properties.getProperty("git.build.time");
if (time != null) {
builtTime =
// RFC 822 date is the default format used by git-commit-id-plugin
new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").parse(time);
builtTime = Date.from(Instant.parse(time));
} else {
builtTime = Date.from(Instant.EPOCH);
}
Expand Down

0 comments on commit 9674154

Please sign in to comment.