aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/signing/ssh/AllowedSigners.java11
1 files changed, 3 insertions, 8 deletions
diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/signing/ssh/AllowedSigners.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/signing/ssh/AllowedSigners.java
index cfbe7a78a7..e31ed64ed9 100644
--- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/signing/ssh/AllowedSigners.java
+++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/signing/ssh/AllowedSigners.java
@@ -21,6 +21,7 @@ import java.text.MessageFormat;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
+import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
@@ -36,8 +37,6 @@ import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
-import java.util.TimeZone;
-import java.util.concurrent.TimeUnit;
import java.util.function.Predicate;
import java.util.stream.Collectors;
@@ -482,12 +481,8 @@ final class AllowedSigners extends ModifiableFileWatcher {
if (isUTC) {
return time.atOffset(ZoneOffset.UTC).toInstant();
}
- TimeZone tz = SystemReader.getInstance().getTimeZone();
- // Since there are a few TimeZone IDs that are not recognized by ZoneId,
- // use offsets.
- return time.atOffset(ZoneOffset.ofTotalSeconds(
- (int) TimeUnit.MILLISECONDS.toSeconds(tz.getRawOffset())))
- .toInstant();
+ ZoneId tz = SystemReader.getInstance().getTimeZoneId();
+ return time.atZone(tz).toInstant();
}
// OpenSSH uses the backslash *only* to quote the double-quote.