What format should a sitemap lastmod date use?
By TechCompare · Updated · How we check
Write lastmod as YYYY-MM-DD, or add a time and zone like 2026-10-23T12:30:15+00:00. Google uses the value only when it's consistently and verifiably accurate.
The lastmod value in a sitemap is a W3C Datetime. The simplest valid form is a date, like 2026-10-23. You can add a time and a time zone after a capital T. Anything else, like 10/23/2026 or a date with a space before the time, is invalid, and the tester lists examples of the bad values it finds.
How it works
The sitemaps.org protocol asks for W3C Datetime and says you can leave out the time and use YYYY-MM-DD. The valid forms are a year (2026), a year and month (2026-10), a full date (2026-10-23), and a date with hours and minutes and a zone (2026-10-23T12:30Z), then with seconds, then with a fraction of a second. The zone is Z or an offset like +02:00. Once there's a time, the zone has to be there too. The tester checks the shape and also that the date exists, so a February 30 is invalid. It can't judge whether a date is true. Google says it uses lastmod when it's consistently and verifiably accurate, and that the value should reflect the last significant update to the page. Stamping every URL with the time of the last deploy tells it nothing about which pages changed. Google also says it ignores priority and changefreq.
Verdict
Fix invalid values first, since a parser may not understand them. Then ask whether each date means a real content change. Set lastmod from when a page's content last changed, not from when the sitemap was built, and leave it out where you can't tell. It's optional.
More Robots.txt scenarios
Frequently asked questions
Is lastmod required?
Does Google use priority and changefreq?
Can I use a Unix timestamp or a slash date?
Related tools
Open Graph Visualizer
Preview how your website links will look when shared on Google, Twitter, Facebook, and Discord.
Use toolSSL Checker
Check a site's certificate, TLS versions, HTTP/2 and HTTP/3 support, post-quantum key exchange, HSTS and redirects, or compare two sites.
Use toolDNS Lookup
Look up a domain's DNS records on Cloudflare or compare several resolvers at once, and read its SPF, DMARC and DKIM records in plain words.
Use tool