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: unknown time zone "Europe/Kyiv" #55899

Closed
veqryn opened this issue Sep 28, 2022 · 12 comments
Closed

time: unknown time zone "Europe/Kyiv" #55899

veqryn opened this issue Sep 28, 2022 · 12 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@veqryn
Copy link
Contributor

veqryn commented Sep 28, 2022

What version of Go are you using (go version)?

1.19.1

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

docker golang:1.19.1-bullseye

What did you do?

https://go.dev/play/p/3IiIaz4JUVV

package main

import (
	"fmt"
	"time"
)

func main() {
	location, err := time.LoadLocation("Europe/Kyiv")
	if err != nil {
		panic(err)
	}
	fmt.Println(location)
}

What did you expect to see?

No errors. Valid timezone.

What did you see instead?

unknown time zone Europe/Kyiv

Comments?

After you add Europe/Kyiv, please do not remove the old spelling (Europe/Kiev), as we have a lot of timezone locations saved as strings in our db and hope to be backwards compatible with them.

@hopehook hopehook changed the title affected/package: "time" unknown time zone Europe/Kyiv time: unknown time zone "Europe/Kyiv" Sep 28, 2022
@hopehook hopehook added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Sep 28, 2022
@hopehook
Copy link
Member

cc @rsc

@hopehook
Copy link
Member

hopehook commented Sep 28, 2022

In my local environment, Go 1.20 is ok. (Unpublished)

FYI: https://go-review.googlesource.com/c/go/+/422875

@seankhliao
Copy link
Member

Time zone data is provided by the operating system, not Go itself.

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Sep 28, 2022
@veqryn
Copy link
Contributor Author

veqryn commented Sep 28, 2022

@hopehook
Copy link
Member

@veqryn Does the latest timezone file solve your problem?

@veqryn
Copy link
Contributor Author

veqryn commented Sep 28, 2022

@hopehook
I ran the Go Play link I provided above and selected "Go dev branch", which the url confirms is "tip", and I still get the following error:

panic: unknown time zone Europe/Kyiv

goroutine 1 [running]:
main.main()
	/tmp/sandbox1613371378/prog.go:11 +0x85

Program exited.

That said, looking at master, it does look like Kyiv was added recently. So I'm not sure why Go Play on Tip/Master is failing.
I'd also like this backported to 1.19.x please.

@hopehook
Copy link
Member

I confirmed, the master branch solved your problem, the version of playground may not be up to date.
In addition, the latest timezone file was released after go1.19, this is not a bug of go1.19, so Backport does not seem to be feasible.

@hopehook
Copy link
Member

also cc @dmitshur

@veqryn
Copy link
Contributor Author

veqryn commented Sep 28, 2022

Feasible? It should be easy and have zero potential for disruption. It also would fix errors people are getting on the latest released version of Golang, even though it may not technically be a 'bug'.

@seankhliao
Copy link
Member

the bundled tzdata needs to be explicitly imported
https://go.dev/play/p/RYhGsSU8Ads?v=gotip

@ZekeLu
Copy link
Contributor

ZekeLu commented Sep 28, 2022

See also #38017:

Importing this package (as import _ "time/tzdata") will cause timezone information to be embedded in the program. Also, building with the build tag timetzdata will force the package to be imported, and therefore will cause timezone information to be embedded in the program. The embedded timezone information will be used if and when no system information is available for the timezone.

@arturyumaev
Copy link

_ "time/tzdata" solves my problem, thanks!

@golang golang locked and limited conversation to collaborators Jul 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

6 participants