Actually log errors.

This commit is contained in:
Sacha Ligthert 2023-02-27 22:02:23 +01:00
parent baf22b802d
commit 1cd285635f

13
tp.go
View File

@ -2,6 +2,7 @@ package main
import (
"fmt"
"log"
"time"
)
@ -80,14 +81,22 @@ func renderDay() string {
}
func getCurrentTime() (time.Time, int) {
// Declarations
var offset int
var loc *time.Location
var err error
// Current Time
ct := time.Now()
// Get the offset from whatever the system timezone is
_, offset := ct.Local().Zone()
_, offset = ct.Local().Zone()
// Make sure that the time is in UTC, so the offset makes sense
loc, _ := time.LoadLocation("UTC")
loc, err = time.LoadLocation("UTC")
if err != nil {
log.Fatal(err)
}
ct = ct.In(loc)
// Return things