12 lines
174 B
Go
12 lines
174 B
Go
|
package utils
|
||
|
|
||
|
import "time"
|
||
|
|
||
|
func GetLocation(timezone string) *time.Location {
|
||
|
loc, err := time.LoadLocation(timezone)
|
||
|
if err == nil {
|
||
|
return loc
|
||
|
}
|
||
|
return time.UTC
|
||
|
}
|