From c2bbb9e560d43eeae670eaa7656ab443f84130e2 Mon Sep 17 00:00:00 2001 From: Jasper Bok Date: Sun, 13 Aug 2023 15:41:54 +0200 Subject: [PATCH] Initial try to parse UNIX time with timezone info --- utils.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/utils.go b/utils.go index a83e1b2..a8c115e 100644 --- a/utils.go +++ b/utils.go @@ -9,10 +9,20 @@ import ( func parseUnixTimestamp(timestamp string) (time.Time, error) { var t = time.Time{} + loc, err := time.LoadLocation("Europe/Amsterdam") + if err != nil { + return t, err + } + i, err := strconv.ParseInt(timestamp, 10, 64) if err != nil { return t, err } - return time.Unix(i, 0), nil + t, err = time.Unix(i, 0), nil + if err != nil { + return t, err + } + + return t.In(loc), nil }