Skip to content

Commit

Permalink
Update GetCurrentTime()
Browse files Browse the repository at this point in the history
  • Loading branch information
nomeguy committed Feb 5, 2024
1 parent a1272c8 commit a4c4c5b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion util/time.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit a4c4c5b

Please sign in to comment.