Per the schema, tLastMod is the union of xsd:date and xsd:dateTime.
Since you provide hours, you are not in the first case, so your string should conform to the XSD dateTime type, and it does not: you need to specify the part with seconds.
See https://www.w3.org/TR/2012/REC-xmlschema11-2-20120405/#dateTime-lexical-mapping for the full format.
So, if you ...
Make sure none of your values are blank. I troubleshooted this for a while and realized my "last edit date" field for certain entries was blank and thus it was causing markup errors in the XML file due to nothing populating for certain URLs
The tool http://tools.seochat.com/tools/site-validator/ gives no error when also specifying the seconds:
Are the seconds required for a datetime? There is a conflict in the spec vs. the schema:
According to the spec for lastmod, specifying the seconds isn’t required for datetimes. The lastmod element ...
The issue turned out to be the colon in header_name = "last-modified:" Basically, there were two colons in the ngnix config file, which lead Chrome to throw an error (Firefox, on the other hand, ignores this and renders the page). The header_name should simply be header_name = "last-modified"
Despite that that the error description indicates the problem is in the "header name," I suspect that the issue is actually with the header_value.
On StackOverflow, The date/time format used in HTTP headers says
In section 14.29 Last-Modified you can see that date format should be:
"Last-Modified" ":" HTTP-date
An example of its use is
Schema.org's getting started guide specifies the expected format for dates.
YYYY-MM-DD format should be used when it is just a date without a time:
It also says how to add the time of day and deal with durations.
[…] if I put my dates in a specific format, will it know that they are dates and therefore exclude them as a keyword […]
I'm almost 100% sure it won't exclude them as keywords. I guess indefinite and definite articles, prepositions and such are much easier for a search algorithm to discount without erroneous results than are day or month names.
I suppose ...
just make sure there will be no space in between a single space will give invalid date or something error like that.
2005-02-21T18:00:15 +00:00 -- space in between
2005-02-21T18:00:15+00:00 -- no spaces here valid markup