{"record":{"id":"87176f524deb8a2f","repo":"gohugoio/hugo","slug":"failed-to-parse-clock-s","errorCode":null,"errorMessage":"failed to parse clock: %s","messagePattern":"failed to parse clock: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/allconfig/allconfig.go","lineNumber":393,"sourceCode":"\t\t\t\treturn fmt.Errorf(\"failed to compile ignoreFiles pattern %q: %s\", pattern, err)\n\t\t\t}\n\t\t}\n\t\tignoreFile = func(s string) bool {\n\t\t\tfor _, r := range regexps {\n\t\t\t\tif r.MatchString(s) {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t}\n\n\tvar clock time.Time\n\tif c.Internal.Clock != \"\" {\n\t\tvar err error\n\t\tclock, err = time.Parse(time.RFC3339, c.Internal.Clock)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to parse clock: %s\", err)\n\t\t}\n\t}\n\n\thttpCache, err := c.HTTPCache.Compile()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Legacy language values.\n\tif c.LanguageCode != \"\" {\n\t\tif !c.isLanguageClone {\n\t\t\thugo.DeprecateWithLogger(\"project config key languageCode\", \"Use locale instead.\", \"v0.158.0\", logger.Logger())\n\t\t}\n\t\tif c.Locale == \"\" {\n\t\t\tc.Locale = c.LanguageCode\n\t\t}\n\t\tc.LanguageCode = \"\"\n\t}","sourceCodeStart":375,"sourceCodeEnd":411,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/config/allconfig/allconfig.go#L375-L411","documentation":"Returned by CompileConfig when `internal.clock` is set but does not parse as an RFC3339 timestamp. The clock is used to pin `now` deterministically (mainly for testing/reproducible builds). time.Parse(time.RFC3339, c.Internal.Clock) failure wraps the parse error here.","triggerScenarios":"Setting `internal.clock` to anything other than a strict RFC3339 string (e.g. '2024-01-01', 'Jan 2 2024', '2024/01/01', or a unix timestamp).","commonSituations":"Authors copying a human-readable date into internal.clock, locale-specific date formats, or omitting the required time/timezone components of RFC3339.","solutions":["Use a strict RFC3339 form: `2006-01-02T15:04:05Z07:00`.","Include the timezone (Z or +HH:MM); bare dates like 2024-01-01 will fail.","Leave internal.clock empty for production builds."],"exampleFix":"// before\n[internal]\nclock = \"2024-01-01\"\n// after\n[internal]\nclock = \"2024-01-01T00:00:00Z\"","handlingStrategy":"validation","validationCode":"func validateClock(s string) error {\n  if s == \"\" { return nil }\n  if _, err := time.Parse(time.RFC3339, s); err != nil { return fmt.Errorf(\"clock must be RFC3339, got %q\", s) }\n  return nil\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use strict RFC3339 form including timezone.","Leave internal.clock unset for production.","Generate the value programmatically: time.Now().Format(time.RFC3339)."],"tags":["config","clock","rfc3339","testing","allconfig"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}