From 14295d12644b9f8d027004c4033a0599ba9823d9 Mon Sep 17 00:00:00 2001 From: Xevion Date: Tue, 26 Dec 2023 07:56:13 -0600 Subject: [PATCH] Use central time for zerolog's timestamp acquisition --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index 6eb2bba..b11f461 100644 --- a/main.go +++ b/main.go @@ -31,6 +31,11 @@ var ( func init() { ctx = context.Background() + // Set zerolog's timestamp function to use the central timezone + zerolog.TimestampFunc = func() time.Time { + return time.Now().In(CentralTime) + } + // Try to grab the environment variable, or default to development environment = GetFirstEnv("ENVIRONMENT", "RAILWAY_ENVIRONMENT") if environment == "" {