From 58c029b5f27721b54a554c92a45416d2a07da9b8 Mon Sep 17 00:00:00 2001 From: sainw Date: Thu, 3 Sep 2026 09:00:13 +0630 Subject: [PATCH] fix format time to MM timezone --- img.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/img.go b/img.go index 823e1e0..b7a81b3 100644 --- a/img.go +++ b/img.go @@ -14,6 +14,7 @@ import ( "strings" "embed" + _ "time/tzdata" "github.com/fogleman/gg" "golang.org/x/image/font" @@ -561,5 +562,11 @@ func formatDateFromSec(input any, layout string) string { return "[Error: unsupported time type]" } t := time.UnixMilli(sec * 1000) + + loc, err := time.LoadLocation("Asia/Rangoon") + if err != nil { + return fmt.Sprintf("[Error: unable to load TZ %v]", err) + } + t = t.In(loc) return t.Format(layout) }