Two Ways to Write a Date

February 20, 2026. That is how you would write today's date in a sentence. Clear, readable, human-friendly.

2026-02-20. That is how a computer prefers it. Year first, then month, then day. No words, just numbers separated by dashes. This format is called ISO 8601, and it is what search engines expect in a sitemap.

Same date. Different formats. The build script needs to handle both.

Where Dates Appear

Every page on Light School has a date comment at the top of its source file. It looks like this:

<!-- DATE: 2026-02-20 -->

That date gets used in the sitemap, which tells search engines when each page was last updated. Search engines use this to decide how often to check back for changes.

The date also appears on blog posts in the human-readable format, like "February 20, 2026". Readers see the friendly version. Search engines see the technical version.

The Tricky Part

Not every page has a date in the same format. Some older pages use the written-out style. Newer pages use the numeric style. Some pages might not have a date at all.

The build script needs to handle all of these cases. If it finds a date, it figures out which format it is in and converts it to the one the sitemap needs. If no date is found, it uses the current date as a fallback.

Why It Matters

An incorrect date in a sitemap can confuse search engines. If every page claims it was updated today, the search engine might stop trusting your dates entirely. If a page has no date, it might get checked less often than it should.

Getting dates right is a small detail. But small details add up. A correct sitemap helps search engines understand your site, and that helps people find your content.

A Solved Problem

Date parsing is one of those problems that sounds simple until you sit down to do it. Time zones, different calendars, edge cases with month names. But for our purposes, we only need to handle two formats and convert between them. That is manageable, and the build script handles it reliably.