---
title: "Show the same date to people and machines · Agent Wranglers"
url: https://agentwranglers.se/playbook/website/seo/publication-dates
updated: 2026-10-21
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Show the same date to people and machines

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [SEO](https://agentwranglers.se/playbook/website/seo.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers). Updated 2026-10-21.

- Level: Recommended
- Chapter: [SEO](https://agentwranglers.se/playbook/website/seo)
- Rule: Show a visible published or updated date on every article, and give the same date in `datePublished` and `dateModified`. Never give a future date, or the date of an event the page describes.
- How: Take both dates from the page data, so the visible date, the JSON-LD and the sitemap `lastmod` agree. Change `dateModified` only when the main content changes, never on every build. Give a time zone with any time, in the format [Send dates as RFC 3339 with a time zone](https://agentwranglers.se/playbook/api-design/requests-and-responses/dates-and-times) uses. Keep other dates on the page to a minimum, so search engines pick the right one.
- Check: A build test reads each article. Its visible `<time datetime>` equals `datePublished` or `dateModified`, `dateModified` equals the sitemap `lastmod`, and no date is later than the build.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### HTML example

```html
<p>Updated <time datetime="2026-09-14">14 September 2026</time></p>
<script type="application/ld+json">
{ "@context": "https://schema.org", "@type": "Article", "headline": "How to care for oak floors",
  "datePublished": "2026-03-02T09:00:00+01:00", "dateModified": "2026-09-14T10:30:00+02:00" }
</script>
```

### JavaScript example

```js
const visible = page.querySelector('time[datetime]').getAttribute('datetime');
const { dateModified } = JSON.parse(page.querySelector('script[type="application/ld+json"]').textContent);
assert.equal(dateModified.slice(0, 10), visible);
assert.equal(sitemapLastmod[url], visible);
```

### Python example

```python
visible = page.select_one("time[datetime]")["datetime"]
date_modified = json.loads(page.select_one('script[type="application/ld+json"]').string)["dateModified"]
assert date_modified[:10] == visible == sitemap_lastmod[url]
```

## Sources

- [Google Search Central – Influence the byline date](https://developers.google.com/search/docs/appearance/publication-dates)

## Related rules

- [Send dates as RFC 3339 with a time zone](https://agentwranglers.se/playbook/api-design/requests-and-responses/dates-and-times) in API design

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/website/seo/publication-dates">Agent Wranglers website playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Mark links you do not vouch for](https://agentwranglers.se/playbook/website/seo/user-link-attributes)
- Next: [Choose what search and AI answers may quote](https://agentwranglers.se/playbook/website/seo/snippet-controls)
- [SEO](https://agentwranglers.se/playbook/website/seo)
