From 597b6ea95c6a8ab016d78615fbd169dde280f7cd Mon Sep 17 00:00:00 2001 From: Yuki Furuyama Date: Tue, 5 Mar 2024 13:33:26 +0900 Subject: [PATCH] fix: use gmdate to format date with UTC irrespective of timezone. --- src/CredentialSource/AwsNativeSource.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CredentialSource/AwsNativeSource.php b/src/CredentialSource/AwsNativeSource.php index 3a8c20eaa6..460d9e5ea4 100644 --- a/src/CredentialSource/AwsNativeSource.php +++ b/src/CredentialSource/AwsNativeSource.php @@ -153,8 +153,8 @@ public static function getSignedRequestHeaders( $service = 'sts'; # Create a date for headers and the credential string in ISO-8601 format - $amzdate = date('Ymd\THis\Z'); - $datestamp = date('Ymd'); # Date w/o time, used in credential scope + $amzdate = gmdate('Ymd\THis\Z'); + $datestamp = gmdate('Ymd'); # Date w/o time, used in credential scope # Create the canonical headers and signed headers. Header names # must be trimmed and lowercase, and sorted in code point order from