This repository has been archived on 2022-09-04. You can view files and clone it, but cannot push or open issues or pull requests.
dataupdater/cron/helpers.go

16 lines
227 B
Go
Raw Normal View History

2020-06-01 19:05:33 +00:00
package cron
import (
"time"
2020-06-01 19:05:33 +00:00
)
func createFnWithTimezone(timezone string, fn func(location *time.Location)) func() {
tz, err := time.LoadLocation(timezone)
if err != nil {
tz = time.UTC
}
return func() {
fn(tz)
}
}