Compare commits

...

2 Commits

Author SHA1 Message Date
Jasper Bok e7960b8253 Add a skeleton readme 2023-08-13 15:42:12 +02:00
Jasper Bok c2bbb9e560 Initial try to parse UNIX time with timezone info 2023-08-13 15:41:54 +02:00
2 changed files with 14 additions and 1 deletions

3
README.md 100644
View File

@ -0,0 +1,3 @@
# Bus Departures
Display bus departures for specific routes on specific stops.

View File

@ -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
}