mirror of
https://github.com/johnkerl/miller.git
synced 2026-01-23 02:14:13 +00:00
Fix local time when TZ is not set (#1649)
Do not override time.Local when TZ is empty or unset. It is already set correctly by go standard library.
This commit is contained in:
parent
5ef01ca356
commit
d1767e7c18
1 changed files with 3 additions and 0 deletions
|
|
@ -16,6 +16,9 @@ import (
|
|||
// statement does 'ENV["TZ"] = Asia/Istanbul'.
|
||||
func SetTZFromEnv() error {
|
||||
tzenv := os.Getenv("TZ")
|
||||
if tzenv == "" {
|
||||
return nil
|
||||
}
|
||||
location, err := time.LoadLocation(tzenv)
|
||||
if err != nil {
|
||||
return fmt.Errorf("TZ environment variable appears malformed: \"%s\"", tzenv)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue