1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00
wtf/clocks/timezones.go
2018-04-18 15:04:10 -07:00

22 lines
335 B
Go

package clocks
import (
"time"
)
func Timezones(locations map[string]interface{}) map[string]time.Time {
times := make(map[string]time.Time)
for label, location := range locations {
tzloc, err := time.LoadLocation(location.(string))
if err != nil {
continue
}
times[label] = time.Now().In(tzloc)
}
return times
}