Actually log errors.
This commit is contained in:
parent
baf22b802d
commit
1cd285635f
13
tp.go
13
tp.go
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user