diff --git a/utils.go b/utils.go index bd53c805..f1953049 100644 --- a/utils.go +++ b/utils.go @@ -335,3 +335,8 @@ func NowFromTZEnv() time.Time { now := time.Now().In(location) return now } + +func TimeFromTZEnv(input time.Time) time.Time { + location, _ := time.LoadLocation(viper.GetString("TZ")) + return input.In(location) +}