From 7fc04e283d3363bdf1d3ce5a6b5fe85b21aa608a Mon Sep 17 00:00:00 2001 From: Deon Thomas Date: Tue, 10 May 2022 14:39:51 -0400 Subject: [PATCH] add func to convert time to TZ env time --- utils.go | 5 +++++ 1 file changed, 5 insertions(+) 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) +}