mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
22 lines
335 B
Go
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
|
|
}
|