Initial try to parse UNIX time with timezone info
parent
aa958b77b1
commit
c2bbb9e560
12
utils.go
12
utils.go
|
@ -9,10 +9,20 @@ import (
|
|||
func parseUnixTimestamp(timestamp string) (time.Time, error) {
|
||||
var t = time.Time{}
|
||||
|
||||
loc, err := time.LoadLocation("Europe/Amsterdam")
|
||||
if err != nil {
|
||||
return t, err
|
||||
}
|
||||
|
||||
i, err := strconv.ParseInt(timestamp, 10, 64)
|
||||
if err != nil {
|
||||
return t, err
|
||||
}
|
||||
|
||||
return time.Unix(i, 0), nil
|
||||
t, err = time.Unix(i, 0), nil
|
||||
if err != nil {
|
||||
return t, err
|
||||
}
|
||||
|
||||
return t.In(loc), nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue