Compare commits
2 Commits
aa958b77b1
...
e7960b8253
Author | SHA1 | Date |
---|---|---|
Jasper Bok | e7960b8253 | |
Jasper Bok | c2bbb9e560 |
|
@ -0,0 +1,3 @@
|
|||
# Bus Departures
|
||||
|
||||
Display bus departures for specific routes on specific stops.
|
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