diff --git a/pkg/cmd/helpers_test.go b/pkg/cmd/helpers_test.go index 08065499e..eff8c49d6 100644 --- a/pkg/cmd/helpers_test.go +++ b/pkg/cmd/helpers_test.go @@ -49,6 +49,12 @@ func init() { func runTestCmd(t *testing.T, tests []cmdTestCase) { t.Helper() + t.Setenv("TZ", "UTC") + prevLocal := time.Local + t.Cleanup(func() { + time.Local = prevLocal + }) + time.Local = time.UTC for _, tt := range tests { for i := 0; i <= tt.repeat; i++ { t.Run(tt.name, func(t *testing.T) { diff --git a/pkg/cmd/history.go b/pkg/cmd/history.go index 3349b7bc1..97aba998e 100644 --- a/pkg/cmd/history.go +++ b/pkg/cmd/history.go @@ -175,7 +175,7 @@ func (r releaseHistory) WriteTable(out io.Writer) error { tbl := uitable.New() tbl.AddRow("REVISION", "UPDATED", "STATUS", "CHART", "APP VERSION", "DESCRIPTION") for _, item := range r { - tbl.AddRow(item.Revision, item.Updated.Format(time.ANSIC), item.Status, item.Chart, item.AppVersion, item.Description) + tbl.AddRow(item.Revision, item.Updated.In(time.Local).Format(time.ANSIC), item.Status, item.Chart, item.AppVersion, item.Description) } return output.EncodeTable(out, tbl) }