forked from Elara6331/infinitime
Use timestamp with timezone offset to (finally) fix weather issue
This commit is contained in:
parent
a01f1b9d92
commit
54fdd19bec
@ -82,8 +82,12 @@ type TimelineHeader struct {
|
|||||||
// NewHeader creates and populates a new timeline header
|
// NewHeader creates and populates a new timeline header
|
||||||
// and returns it
|
// and returns it
|
||||||
func NewHeader(evtType EventType, expires time.Duration) TimelineHeader {
|
func NewHeader(evtType EventType, expires time.Duration) TimelineHeader {
|
||||||
|
now := time.Now()
|
||||||
|
_, offset := now.Zone()
|
||||||
|
now = now.Add(time.Duration(offset) * time.Second)
|
||||||
|
|
||||||
return TimelineHeader{
|
return TimelineHeader{
|
||||||
Timestamp: uint64(time.Now().Unix()),
|
Timestamp: uint64(now.Unix()),
|
||||||
Expires: uint32(expires.Seconds()),
|
Expires: uint32(expires.Seconds()),
|
||||||
EventType: evtType,
|
EventType: evtType,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user