fix(timezone): the timezone is standardized to UTC

Signed-off-by: cndoit18 <cndoit18@outlook.com>
This commit is contained in:
cndoit18
2021-06-03 13:43:11 +08:00
parent d541872f9a
commit 51717256f9
9 changed files with 15 additions and 15 deletions

View File

@@ -23,7 +23,7 @@ import (
"errors"
"time"
"k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait"
@@ -79,9 +79,9 @@ func addSecretExpiration(s *v1.Secret, expiration string) {
}
// TimeStringFromNow returns the time as a string from now.
// e.g: 2019-12-03T14:30:40+08:00.
// e.g: 2019-12-03T06:30:40Z.
func TimeStringFromNow(delta time.Duration) string {
return time.Now().Add(delta).Format(time.RFC3339)
return time.Now().Add(delta).UTC().Format(time.RFC3339)
}
// WaitforSignedClusterInfoByBootStrapToken waits for signed cluster info by bootstrap token.