{"record":{"id":"3ba31ac4a9d45fc4","repo":"gohugoio/hugo","slug":"the-q-front-matter-field-is-not-a-parsable-date","errorCode":null,"errorMessage":"the %q front matter field is not a parsable date: see %s","messagePattern":"the %q front matter field is not a parsable date: see (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"resources/page/pagemeta/page_frontmatter.go","lineNumber":1034,"sourceCode":"\t\tif found {\n\t\t\td.PageConfigLate.Params[key] = v\n\t\t} else {\n\t\t\t// Reentry from previous handlers.\n\t\t\tv, found = d.PageConfigLate.Params[key]\n\t\t}\n\n\t\tif !found || v == \"\" || v == nil {\n\t\t\treturn false, nil\n\t\t}\n\n\t\tvar date time.Time\n\t\tif vt, ok := v.(time.Time); ok && vt.Location() == d.Location {\n\t\t\tdate = vt\n\t\t} else {\n\t\t\tvar err error\n\t\t\tdate, err = htime.ToTimeInDefaultLocationE(v, d.Location)\n\t\t\tif err != nil {\n\t\t\t\treturn false, fmt.Errorf(\"the %q front matter field is not a parsable date: see %s\", key, d.PathOrTitle)\n\t\t\t}\n\t\t\td.PageConfigLate.Params[key] = date\n\t\t}\n\n\t\t// We map several date keys to one, so, for example,\n\t\t// \"expirydate\", \"unpublishdate\" will all set .ExpiryDate (first found).\n\t\tsetter(d, date)\n\n\t\treturn true, nil\n\t}\n}\n\nfunc (f *frontmatterFieldHandlers) newDateFilenameHandler(setter func(d *FrontMatterDescriptor, t time.Time)) frontMatterFieldHandler {\n\treturn func(d *FrontMatterDescriptor) (bool, error) {\n\t\tdate, slug := dateAndSlugFromBaseFilename(d.Location, d.BaseFilename)\n\t\tif date.IsZero() {\n\t\t\treturn false, nil\n\t\t}","sourceCodeStart":1016,"sourceCodeEnd":1052,"githubUrl":"https://github.com/gohugoio/hugo/blob/52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2/resources/page/pagemeta/page_frontmatter.go#L1016-L1052","documentation":"Thrown (and logged, not fatal) by the date front matter handler when a configured date field (date, lastmod, publishdate, expirydate, or a custom date key) holds a value that htime.ToTimeInDefaultLocationE cannot parse. The chained handler logs it and continues to the next candidate, so the page still builds but that date stays unset.","triggerScenarios":"Front matter sets e.g. 'date: 2024-13-99' or 'date: not-a-date', or a value in a locale-specific format Hugo's date parser rejects (e.g. '31/12/2024' depending on config).","commonSituations":"Hand-editing front matter with malformed dates, copying dates from spreadsheets in DD/MM/YYYY, or switching date formats after migration. The error names the field and the page path so the offending file is easy to find.","solutions":["Use an ISO 8601 date/datetime in the flagged front matter field (YYYY-MM-DD or RFC3339).","Verify the field named in the error message matches an intended date key.","Configure [frontmatter] date keys/formats if you need a non-default date source or format."],"exampleFix":"# before\n---\ndate: 2024-13-99\n---\n# after\n---\ndate: 2024-12-31T15:00:00Z\n---","handlingStrategy":"validation","validationCode":"if _, err := htime.ToTimeInDefaultLocationE(fm[key], loc); err != nil {\n    return fmt.Errorf(\"field %q is not a valid date\", key)\n}","typeGuard":null,"tryCatchPattern":"// logged by the chained handler; no fatal stop.\n// To surface it, grep the build log for 'not a parsable date'.","preventionTips":["Write dates in ISO 8601 / RFC3339 in front matter.","Avoid locale-specific or ambiguous date formats.","Lint front matter dates in CI."],"tags":["hugo","front-matter","date-parsing","dates"],"backgroundTag":null,"analyzedSha":"52c9bd7908b4d02d4d0ff8f82a888834d6ee10d2","analyzedAt":"2026-08-09T21:49:36.660Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}