add
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"os"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Logger interface {
|
||||
@@ -64,3 +65,15 @@ func SetupFile(path string) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func SetupTimezone(tz string) error {
|
||||
if tz == "" {
|
||||
return fmt.Errorf("timezone empty")
|
||||
}
|
||||
loc, err := time.LoadLocation(tz)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
time.Local = loc
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user