diff --git a/pkg/utils/dwelling.go b/pkg/utils/dwelling.go index 23f178b..63e8a91 100644 --- a/pkg/utils/dwelling.go +++ b/pkg/utils/dwelling.go @@ -22,11 +22,9 @@ func MainSite(host string) string { // converts to UTC. func ToClientTimezone(t time.Time, r *http.Request) time.Time { if tz := r.Header.Get("X-Client-Timezone"); tz != "" { - loc, err := time.LoadLocation(tz) - if err != nil { - return t.UTC() + if loc, err := time.LoadLocation(tz); err == nil { + return t.In(loc) } - return t.In(loc) } return t.UTC() }