Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

time: time.now () uses the time zone to modify the problem #65228

Closed
xlango opened this issue Jan 23, 2024 · 1 comment
Closed

time: time.now () uses the time zone to modify the problem #65228

xlango opened this issue Jan 23, 2024 · 1 comment

Comments

@xlango
Copy link

xlango commented Jan 23, 2024

Go version

go1.21.5 linux amd64

Output of go env in your module/workspace:

GO111MODULE='on'
GOARCH='amd64'
GOBIN=''
GOCACHE='/root/.cache/go-build'
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/go'
GOPRIVATE=''
GOPROXY='https://goproxy.cn,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.5'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1322244283=/tmp/go-build -gno-record-gcc-switches'

What did you do?

time.now () Obtains the current time of the linux system

What did you see happen?

After the time zone of the golang program running in the linux environment is modified, the time zone obtained by using time.now () in the golang program is still the time zone before the modification, and the time zone of the golang program must be updated again. How to solve this problem?

What did you expect to see?

After updating the time zone of the linux system, the golang program automatically refreshes without restarting

@mengzhuo mengzhuo changed the title time.now () uses the time zone to modify the problem time: time.now () uses the time zone to modify the problem Jan 23, 2024
@seankhliao
Copy link
Member

Duplicate of #28020

@seankhliao seankhliao marked this as a duplicate of #28020 Jan 23, 2024
@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants