From 54fdd19bec3c6db666377d623f664cc083e79b47 Mon Sep 17 00:00:00 2001 From: Arsen Musayelyan Date: Thu, 20 Oct 2022 01:41:15 -0700 Subject: [PATCH] Use timestamp with timezone offset to (finally) fix weather issue --- weather/weather.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/weather/weather.go b/weather/weather.go index 7a8765d..1265c50 100644 --- a/weather/weather.go +++ b/weather/weather.go @@ -82,8 +82,12 @@ type TimelineHeader struct { // NewHeader creates and populates a new timeline header // and returns it func NewHeader(evtType EventType, expires time.Duration) TimelineHeader { + now := time.Now() + _, offset := now.Zone() + now = now.Add(time.Duration(offset) * time.Second) + return TimelineHeader{ - Timestamp: uint64(time.Now().Unix()), + Timestamp: uint64(now.Unix()), Expires: uint32(expires.Seconds()), EventType: evtType, }