---
type: Article
title: Solving a date display issue in 11ty templates
description: Fixed a date display issue in 11ty templates by applying the toDateString to format update dates properly to comply with Google’s sitemap requirements.
resource: https://www.simoncox.com/short-articles/2023-07-07-solving-a-date-display-issue-in-11ty-templates/
tags: [Shorticles, Eleventy, SEO]
timestamp: 2023-10-30
---

I have recently changed the [lastmod date in my xml site map to be accurate](https://www.simoncox.com/post/2023-07-06-lastmod-in-xml-sitemap-for-11ty/) now that Google are wanting that. Part of what Google wanted was for the page to state the update date on it. I pulled this data from the posts front matter but because I had set an 11ty filter for the sitemap the output on the page was the full UTC:

**Updated:** **2023-04-03T00:00:00.000**


The resolution was to add .toDateString() to the front matter item, dateUpdated, in the template giving me: 

`dateUpdated.toDateString()`

Which displays as:

**Updated:** **Mon Apr 03 2023**

*Far better!*

[Read full article](https://www.simoncox.com/short-articles/2023-07-07-solving-a-date-display-issue-in-11ty-templates/)
