diff --git a/builtin/logical/database/path_creds_create.go b/builtin/logical/database/path_creds_create.go index d8696fc0a1..53ca3b7bdb 100644 --- a/builtin/logical/database/path_creds_create.go +++ b/builtin/logical/database/path_creds_create.go @@ -268,6 +268,10 @@ func (b *databaseBackend) pathStaticCredsRead() framework.OperationFunc { if role.StaticAccount.RotationWindow.Seconds() != 0 { respData["rotation_window"] = role.StaticAccount.RotationWindow.Seconds() } + + // The schedule is in UTC, but we want to convert it to the local time + role.StaticAccount.Schedule.Location = time.Local + respData["ttl"] = role.StaticAccount.CredentialTTL().Seconds() } switch role.CredentialType { diff --git a/changelog/28509.txt b/changelog/28509.txt new file mode 100644 index 0000000000..821f841146 --- /dev/null +++ b/changelog/28509.txt @@ -0,0 +1,3 @@ +```release-note:bug +databases: fix issue where local timezone was getting lost when using a rotation schedule cron +```