From 9dae1ed9e95eedff97fecb276f2d63850b249765 Mon Sep 17 00:00:00 2001 From: sergiyvamz Date: Wed, 4 Dec 2024 10:18:11 -0800 Subject: [PATCH] use UTC timezone --- .../java/software/amazon/jdbc/plugin/iam/LightRdsUtility.java | 4 ++-- .../amazon/awssdk/services/rds/TestDefaultRdsUtilities.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wrapper/src/main/java/software/amazon/jdbc/plugin/iam/LightRdsUtility.java b/wrapper/src/main/java/software/amazon/jdbc/plugin/iam/LightRdsUtility.java index 6606f47a8..680832d23 100644 --- a/wrapper/src/main/java/software/amazon/jdbc/plugin/iam/LightRdsUtility.java +++ b/wrapper/src/main/java/software/amazon/jdbc/plugin/iam/LightRdsUtility.java @@ -43,12 +43,12 @@ public class LightRdsUtility implements IamTokenUtility { private final Clock clock; public LightRdsUtility() { - this.clock = Clock.systemDefaultZone(); + this.clock = Clock.systemUTC(); } // For testing only public LightRdsUtility(final Instant fixedInstant) { - this.clock = Clock.fixed(fixedInstant, ZoneId.systemDefault()); + this.clock = Clock.fixed(fixedInstant, ZoneId.of("UTC")); } @Override diff --git a/wrapper/src/test/java/software/amazon/awssdk/services/rds/TestDefaultRdsUtilities.java b/wrapper/src/test/java/software/amazon/awssdk/services/rds/TestDefaultRdsUtilities.java index 7d1a98234..d55cb90e7 100644 --- a/wrapper/src/test/java/software/amazon/awssdk/services/rds/TestDefaultRdsUtilities.java +++ b/wrapper/src/test/java/software/amazon/awssdk/services/rds/TestDefaultRdsUtilities.java @@ -33,6 +33,6 @@ public static DefaultRdsUtilities getDefaultRdsUtilities( final DefaultBuilder builder = (DefaultBuilder) new DefaultBuilder() .credentialsProvider(credentialsProvider) .region(region); - return new DefaultRdsUtilities(builder, Clock.fixed(fixedInstant, ZoneId.systemDefault())); + return new DefaultRdsUtilities(builder, Clock.fixed(fixedInstant, ZoneId.of("UTC"))); } }