+
+// Issue 30099.
+func TestEarlyLocation(t *testing.T) {
+ time.ForceZipFileForTesting(true)
+ defer time.ForceZipFileForTesting(false)
+
+ const locName = "America/New_York"
+ loc, err := time.LoadLocation(locName)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ d := time.Date(1900, time.January, 1, 0, 0, 0, 0, loc)
+ tzName, tzOffset := d.Zone()
+ if want := "EST"; tzName != want {
+ t.Errorf("Zone name == %s, want %s", tzName, want)
+ }
+ if want := -18000; tzOffset != want {
+ t.Errorf("Zone offset == %d, want %d", tzOffset, want)
+ }
+}