You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On Windows, timezone calculations require presence of zoneinfo.zip file, which is found via the ZONEINFO environment variable. But in my situation, I am unable to set env vars, and it's not possible to re-set ZONEINFO after Go execution has already begun.
Would it be possible to add a method to time package to allow re-loading ZONEINFO from a custom path?
I tried os.Setenv() in main.init(), but, it had no effect, as below.
Right now i can only perform a workaround relaunching the binary with different environment.
Thanks
What version of Go are you using (go version)?
go version go1.7.3 windows/amd64
What operating system and processor architecture are you using (go env)?
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\cygwin\tmp\go-build715340254=/tmp/go-build -gno-record-gcc-switches
set CXX=g++
set CGO_ENABLED=1
Yeah, we could probably consult ZONEINFO lazily at the first call to LoadLocation, or check its modification after LoadLocation failures before subsequent LoadLocation calls.
Hi,
On Windows, timezone calculations require presence of zoneinfo.zip file, which is found via the ZONEINFO environment variable. But in my situation, I am unable to set env vars, and it's not possible to re-set ZONEINFO after Go execution has already begun.
Would it be possible to add a method to
time
package to allow re-loading ZONEINFO from a custom path?I tried
os.Setenv()
inmain.init()
, but, it had no effect, as below.Right now i can only perform a workaround relaunching the binary with different environment.
Thanks
What version of Go are you using (
go version
)?go version go1.7.3 windows/amd64
What operating system and processor architecture are you using (
go env
)?set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\cygwin\tmp\go-build715340254=/tmp/go-build -gno-record-gcc-switches
set CXX=g++
set CGO_ENABLED=1
What did you do?
What did you expect to see?
Europe/London <nil>
What did you see instead?
UTC open C:\Go\\lib\time\zoneinfo.zip: The system cannot find the file specified.
The text was updated successfully, but these errors were encountered: