From a4c4c5bf48404d6976391629db11a7c8b2397604 Mon Sep 17 00:00:00 2001 From: Gucheng Wang Date: Mon, 5 Feb 2024 10:01:44 +0800 Subject: [PATCH] Update GetCurrentTime() --- util/time.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/util/time.go b/util/time.go index 13de0d0..64a22eb 100644 --- a/util/time.go +++ b/util/time.go @@ -17,7 +17,12 @@ package util import "time" func GetCurrentTime() string { + location, err := time.LoadLocation("Asia/Singapore") + if err != nil { + panic(err) + } + timestamp := time.Now().Unix() tm := time.Unix(timestamp, 0) - return tm.Format(time.RFC3339) + return tm.In(location).Format(time.RFC3339) }