+ /* Valid mdoc(7) date format. */
+
+ if (a2time(&t, "$" "Mdocdate: %b %d %Y $", in) ||
+ a2time(&t, "%b %d, %Y", in))
+ return time2a(t);
+
+ /* In man(7), do not warn about the legacy format. */
+
+ if (a2time(&t, "%Y-%m-%d", in) == 0)
+ mandoc_msg(MANDOCERR_DATE_BAD, man->parse, ln, pos, in);
+ else if (man->macroset == MACROSET_MDOC)
+ mandoc_vmsg(MANDOCERR_DATE_LEGACY, man->parse,
+ ln, pos, "Dd %s", in);
+
+ /* Use any non-mdoc(7) date verbatim. */
+
+ return mandoc_strdup(in);
+}