{"record":{"id":"6b087bc16fcc2481","repo":"GoogleContainerTools/skaffold","slug":"bad-timezone-provided-q-error-s","errorCode":null,"errorMessage":"bad timezone provided: %q, error: %s","messagePattern":"bad timezone provided: %q, error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/tag/date_time.go","lineNumber":60,"sourceCode":"\t\ttimeFn:   time.Now,\n\t}\n}\n\n// GenerateTag generates a tag using the current timestamp.\nfunc (t *dateTimeTagger) GenerateTag(ctx context.Context, image latest.Artifact) (string, error) {\n\tformat := tagTime\n\tif len(t.Format) > 0 {\n\t\tformat = t.Format\n\t}\n\n\ttimezone := \"Local\"\n\tif len(t.TimeZone) > 0 {\n\t\ttimezone = t.TimeZone\n\t}\n\n\tloc, err := time.LoadLocation(timezone)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"bad timezone provided: %q, error: %s\", timezone, err)\n\t}\n\n\treturn t.timeFn().In(loc).Format(format), nil\n}\n","sourceCodeStart":42,"sourceCodeEnd":65,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/tag/date_time.go#L42-L65","documentation":"The date/time Tagger formats the current time in a configured IANA time zone. Before formatting it calls time.LoadLocation on the configured TimeZone; if Go cannot resolve that string to a known location (e.g. an invalid name, or no tzdata available on the system), it returns this error instead of a tag.","triggerScenarios":"skaffold.yaml sets tagger.date_Time.timeZone to a string that time.LoadLocation cannot resolve — a typo like 'utc', a wrong case, a full path with missing zoneinfo database, or a non-IANA alias. Also occurs on minimal/stripped Docker images (alpine, scratch) that lack /usr/share/zoneinfo and where the binary was not built with the embedded tzdata import.","commonSituations":"Deploying builds inside slim containers without the tzdata package; copying a timeZone value from another tool that expects a POSIX TZ string or a UTC offset like '+02:00' instead of an IANA name like 'Europe/Berlin'; typos after editing skaffold.yaml.","solutions":["Set timeZone to a valid IANA name (check `timedatectl` or the IANA list), e.g. 'UTC' or 'America/New_York'","Install tzdata in the build/run image (apk add tzdata / apt-get install tzdata) so LoadLocation can resolve names","Import _ 'time/tzdata' in the binary to embed the zone database when building scratch/distroless images","Remove the timeZone field to fall back to the default local time"],"exampleFix":"// before\n{\n  \"tagger\": { \"date_Time\": { \"format\": \"2006-01-02\", \"timeZone\": \"utc+2\" } }\n}\n// after\n{\n  \"tagger\": { \"date_Time\": { \"format\": \"2006-01-02\", \"timeZone\": \"UTC\" } }\n}","handlingStrategy":"validation","validationCode":"if _, err := time.LoadLocation(cfg.Tagger.DateTime.TimeZone); err != nil {\n    return fmt.Errorf(\"invalid tagger timeZone %q: %w\", cfg.Tagger.DateTime.TimeZone, err)\n}","typeGuard":"func isValidTimeZone(tz string) bool {\n    if tz == \"\" || tz == \"Local\" { return true }\n    _, err := time.LoadLocation(tz)\n    return err == nil\n}","tryCatchPattern":null,"preventionTips":["Only use IANA zone names like UTC or Europe/Berlin in skaffold.yaml","Install tzdata in build/CI images","Import _ \"time/tzdata\" for scratch/distroless binaries","Add a config lint step validating timeZone before builds"],"tags":["go","skaffold","timezone","tagging","configuration"],"backgroundTag":"invalid-timezone","analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}