DEV Community

Cover image for Every Post on My Blog Says It Appeared at Midnight
Mustafa ERBAY
Mustafa ERBAY

Posted on Originally published at mustafaerbay.com.tr

Every Post on My Blog Says It Appeared at Midnight

Three posts went live on this blog yesterday; their files landed in the repository at 09:24,
14:32 and 17:30. Look at the feed and all three report the same publication instant:

2026-11-18T00:00:00.000Z
2026-11-18T00:00:00.000Z
2026-11-18T00:00:00.000Z
Enter fullscreen mode Exit fullscreen mode

The repetition is no surprise; I wrote the code that fills that field. What caught my eye was
the trailing .000. Those three digits are a claim about measurement: they say "I know when
this post appeared, down to the millisecond." I don't. I never did.

Three posts, one instant

Start with the scale. This morning the live feed.json publishes 1,430 posts, and the number
of distinct timestamps those posts carry is 249. That's 5.7 posts per timestamp.

The distribution is harsher than the average. 229 timestamps are shared by at least two posts,
and those groups contain 1,410 posts between them. Only 20 posts have an instant of their
own. The most crowded stamp belongs to 17 April 2026, with 31 posts under it. The last thirty
days look the same: 29 timestamps, 78 posts, 28 of the timestamps shared.

The practical consequence: anything that sorts by timestamp — an RSS client, an aggregator, a
search engine — cannot order yesterday's three posts. It has to sort, so it sorts by something
else. Which post came first is something I know and my feed doesn't.

It has milliseconds, not a time

The stamp doesn't sit in one place. I opened the page of the 17 November post and counted: the
same value is published on five separate surfaces, each with the same claim to precision.

Surface Published value
feed.json → date_published 2026-11-17T00:00:00.000Z
feed.json → date_modified 2026-11-17T00:00:00.000Z
sitemap-0.xml → lastmod 2026-11-17T00:00:00.000Z
JSON-LD → datePublished / dateModified 2026-11-17T00:00:00.000Z
<time datetime=...> and article:published_time 2026-11-17T00:00:00.000Z

The sitemap holds 2,870 lastmod lines and the format breakdown is a single entry: every one
ends in .000Z. Of the 2,891 URLs in the sitemap, only 21 carry no lastmod — the home page,
the archive, the about page. The odd part: those 21 addresses, the ones that declare no date,
are the only group whose date isn't wrong.

There is a sixth and seventh surface, and they strengthen the point: rss.xml and
/en/rss.xml publish that same post as Tue, 17 Nov 2026 00:00:00 GMT. The same Date
object goes through toUTCString() there, and since RSS's date format has no millisecond
field there is nothing to invent. The .000 isn't something publishing demands; it's the
residue of one function.

That function is toISOString(). In MDN's words its output is "always 24 or 27 characters
long" and "The timezone is always UTC, as denoted by the suffix Z". The millisecond field
isn't optional: with no such information in hand, three digits still get written, padded with
zeros.

I once wrote the opposite of this here: clock_getres advertised my clock's step as
1 millisecond while the real step measured 41 nanoseconds
(My Clock Advertised 1 ms and Stepped Every 41 Nanoseconds).
There the system declared something coarser than what it had; here it declares precision it
doesn't have. The first loses information, the second invents it.

Who picked midnight

I followed the chain, because I knew the answer would end with me. It did — but not in one
place. In three.

It starts with the posts. In 2,860 of the 2,860 files in my content folder, publishDate
is a date and nothing else, like 2026-11-18. There is no time field in any of them.

My first guess was Astro's schema, and it was wrong. This blog moved to build-free publishing
in June 2026, the blog collection was removed from Astro, and today src/content.config.ts
exports only the shorts collection. There isn't a single place that reads the frontmatter
behind the surfaces that publish the stamp, either; there are two code paths.

The first path is the page itself. The content database that feeds the JSON feed, the
JSON-LD, the og tags and RSS is written by scripts/migrate-content.mjs, and the frontmatter
is parsed by the scripts/render-article.mjs it calls — where there is one line:
yaml.load(...). The parser is js-yaml 4.3.2, which implements YAML 1.1's timestamp
type, so an unquoted date arrives not as a string but as a Date object. Measured on my own
setup:

publishDate: 2026-11-18                -> Date 2026-11-18T00:00:00.000Z
publishDate: "2026-11-18"              -> string "2026-11-18"
publishDate: 2026-11-19T08:30:00       -> Date 2026-11-19T08:30:00.000Z
publishDate: 2026-11-19T08:30:00+03:00 -> Date 2026-11-19T05:30:00.000Z
Enter fullscreen mode Exit fullscreen mode

The source says the same thing: in js-yaml/lib/type/timestamp.js the date-only branch
returns new Date(Date.UTC(year, month, day)), the branch with a time builds Date.UTC(...)
as well and only subtracts an offset afterwards if a timezone was given. YAML 1.1's timestamp
document states the rule in two sentences: with the timezone omitted the stamp is assumed to
be UTC, and with the time part omitted it is taken as 00:00:00Z.

The second path is the sitemap. scripts/collect-sitemap-urls.mjs never calls js-yaml;
the reason is written at the top of the file — frontmatter only holds simple values, so rather
than add a dependency I wrote a small regex parser there. In that parser the value stays a
string, and the lastmod line runs new Date(string) on it. So midnight in the sitemap
isn't picked by YAML; JavaScript picks it. MDN's Date.parse() rule applies here: a date-only
string is taken as UTC ("The first will imply UTC time because it's date-only").

There is no third file, but there is a branch inside the first path: in the two quoted
files the value stays a string in js-yaml's hands too, so those also fall to JavaScript's
rule.

All three arrive at the same answer: midnight UTC. That isn't an agreement, it's a coincidence
of defaults — and it is exactly why nobody noticed.

To see that it is a coincidence, I handed the two readers the same text:

2026-11-19T08:30:00  ->  js-yaml  : 2026-11-19T08:30:00.000Z
2026-11-19T08:30:00  ->  new Date : 2026-11-19T05:30:00.000Z   (Europe/Istanbul)
Enter fullscreen mode Exit fullscreen mode

One line, one repository, two surfaces, three hours apart. Write that line and my feed would
publish 08:30 while my sitemap published 05:30, and each would be right according to its own
documentation.

Diagram

Istanbul is on UTC+3. So my feed says every post "appeared at 03:00 on 18 November", while
today's pipeline runs at 08:30, 13:30 and 16:30 and publishes nothing at that hour. For the
past I can't say the same: converting repository add instants to Istanbul time, there are
73 add events in the 03:00 hour, which correspond to 67 files still present today. All of
them fall before 9 September 2026, which is when the hourly generation cron was retired; zero
after that date. In that era the stamp wasn't wrong — it was accidentally right.

How wrong is it

That needs measuring. For every post I compared two instants: the one the feed claims (UTC
midnight) and the instant of the commit that first added the file. The second is a record I
actually hold.

All numbers come from one snapshot: origin/main = ececf068, the morning of 19 November
2026, path filter -- src/content/blog, commit time taken as the committer date (%cI).

  • Files with a findable add record, and therefore comparable: 2,858
  • Median gap: 12.94 hours
  • Files whose stamp is earlier than reality: 2,810 · later: 48 · exactly equal: 0
  • For posts published after 1 September 2026, the median is 11.28 hours
  • Over the last 30 days (n=156): median 11.39 hours, minimum 5.70, maximum 19.27

A typical post claims to have existed about half a day before it did.

Dropping to calendar days turned up something else. Converting the commit instant to Istanbul
time and comparing it with the claimed date: 2,153 files match, 705 don't. In one file out
of four the stamp doesn't even name the day the post was written.

The largest gap is 758 days and I don't like the explanation. The publishDate of
life/tukenmislik-geldiginde-gec-anladigim-sey reads 16 May 2024; its first commit is
13 June 2026. I'd like to tell you I backdated an older piece on purpose; the repository won't
let me. That commit's author is Content Bot and its subject is
feat: auto-generated content 2026-06-13. The archive holds 54 files dated 2024; 52 follow
that same pattern and two arrived later in a translation batch. The clearest instance of the
thing this post complains about — a machine declaring a date it never measured — is sitting in
my own archive, and I can't find a record of the decision.

The largest gap in the other direction is 41 days:
technology/production-bugs-that-werent-bugs.en.mdx was written on 30 July and dated
10 September. That one is deliberate; the editorial series is scheduled forward.

Two files the count can't see, as well: the bootstrap-deadlock-cluster-domain-controller
twins were added on 9 June as .md and renamed to .mdx on 11 August, so --diff-filter=A
finds no add record for today's path. Those two are also the only renames in the repository's
whole content history.

The real cost is in the corrections

Everything up to here is irritating but harmless. Half a day of drift costs nobody anything.
The cost lives in the second half of the stamp.

In 1,430 of the 1,430 feed items, date_modified is byte-for-byte identical to
date_published. The sitemap is the same. The reason is one line of code: write the updated
date if there is one, otherwise write the publication date.

There is never an updated date — and the real problem isn't the empty field, it's that nothing
is expecting it. updatedDate is not in the schema; it was deleted along with the blog
collection on 29 June 2026. The consuming side is all still there: the line that writes to the
database reads the field, the SEO head is ready to print article:modified_time, the JSON-LD
component uses it as dateModified, the post layout is waiting to add an "updated" row. For
close to five months I've had a field that would work if filled, and that nothing would check
once it was.

The posts, meanwhile, really have been corrected. Here is the count: each file's current body
was compared with the body of the version first committed, with frontmatter left out and
whitespace normalised.

  • Files whose body differs from their first version: 954
  • 702 of them are Turkish — that is 49.1% of my Turkish posts
  • By category: technology 340, tutorials 277, career 201, life 136

A concrete example: in
I Left a Stale .gz and Nginx 1.31.7 Served Two Bodies at One URL
I corrected a claim about my own nginx configuration — the sentence saying "the only place
serving files from disk" was not true, there were two. The page's markup still says that post
hasn't been touched since publication: no article:modified_time, and dateModified equal to
the publication date. A reader has no way of learning that a correction happened.

That example isn't wrong as far as lastmod goes, though, because the correction landed
fifteen minutes after publication, the same day. The right question has to be asked at day
resolution: for each of the 954 files I found the commit that last changed the body and
compared its date with publishDate. In 911 of them the last body change falls on a day
after the publication date; 32 fall on the same day (the nginx post is in this group), 3
before, and 8 can't be traced — those eight were deleted at some point and added again at the
same path, so the re-add event has no previous version to compare against and the walk
backwards stops there.

Google's sitemap guide asks lastmod to be "the date and time of the last significant update
to the page", noting that "an update to the main content... is generally considered
significant"; the same page says Google uses the value only when it is "consistently and
verifiably... accurate". In 911 files the main content changed and lastmod didn't move. The
thing that shows the value is verifiably wrong is my own repository.

How this differs from two earlier posts

I've touched this same surface twice this month, so let me name both.

I Wrote Sharing State Into the Post; My Archive Changes Daily
(15 November) counted these corrections: of 9,721 edit events only 998 touched a sentence.
That post asked where my time goes. The question here is how much of those corrections reaches
the reader; the answer is none. The units differ too — there I counted per-file edit events,
here files.

My Sitemap Says tr-TR, My Pages Say tr
(6 November) named lastmod in its closing and argued that "The moment a claim has a default,
it stops being claimed and starts merely being said." The flaw there was a default speaking
for 2,789 pages about which I had decided nothing. Here I did decide — I wrote the date
myself. And what fills the missing piece isn't a single default but two libraries reading the
same text under two different rules. Same surface, different layer.

A floor for the count, not a ceiling

I should say which way 954 can be wrong.

The body comparison leaves frontmatter out, but not everything in frontmatter is invisible:
faq blocks are printed on the page as questions and answers. So 954 is a floor, not a
ceiling.

I saw that in numbers. I opened one of the files counted as unchanged with git diff: 14 lines
added, 4 removed. Most of what changed were fields that already existed — coverImageAlt
rewritten, socialMedia flags flipped from false to true. The only wholly new key was
faq: four questions and four answers, all of which reach the page. So while the count was
calling that file untouched, four new headings had opened up for the reader. The number of
files carrying that same shape is 23. The second method didn't confirm the boundary; it showed
which way the boundary leaks.

One more detail: I left coverImageAlt out of the visible fields above, because it isn't one.
The cover <img> tag was removed from this blog on 30 June 2026; today that field only reaches
the media:description line in RSS. I've written about that here separately, too.

Two more limits. The comparison runs between the first version and today's, so a paragraph that
changed and was later reverted reads as "unchanged". And the first commit is not the moment the
post became readable: the deploy workflow excludes the src/content/** path from its triggers,
so a content commit doesn't deploy itself. The real publication instant comes after the commit;
the 12.94-hour gap is a lower bound on what the reader experienced.

What the standards ask, and what they don't

None of this means I'm violating a standard.

On schema.org, datePublished and dateModified expect Date or DateTime, and
schema.org's own example is date-only: "datePublished": "2009-05-08". Writing 2026-11-17
into the JSON-LD would have been valid. Google's publication-dates page says "The date is
required; the time is not", then adds "we recommend you provide a time and timezone in markup
for added precision". Even the lastmod example in the sitemap guide is a bare date.

The side that forces my hand is the feed format. JSON Feed 1.1 gives RFC 3339 as the format for
date_published, and in RFC 3339's grammar full-date and date-time are different things
(date-time = full-date "T" full-time), with full-time always carrying a time offset. A bare
date is not a date-time.

One thing I need to correct as well: the Z in the stamp is not wrong. The value really is UTC
midnight, and Z labels it correctly. What's wrong is the instant, not the zone. In the same
way, the visible date on the page and the date in the markup agree, so nothing here breaks
Google's "make your visible and structured values match" rule. The one side effect is this:
because the stamp is UTC midnight, a feed client west of UTC formats the 17 November post
as the evening of 16 November. The date printed on the page is server-rendered text and doesn't
shift for anyone; what shifts is the client that converts the instant to local time.

That's how I've come to picture the chain: the format wants an instant, I hold a day, and the
parser quietly fills the gap. Nobody is lying; nobody mentions that the gap was filled either.

I won't invent dates for the past

This blog has a period in which 455 posts were cleaned of invented measurements and fake
narratives. So the first fix that comes to mind — writing a plausible-looking time into the
2,860 files behind those 1,430 posts — is the one I won't do. Inventing a measurement I never
took so a format feels satisfied is the very thing this post complains about.

The work that rests on records I actually hold:

  1. updatedDate gets filled on corrections from now on — but its gate gets written first. The consuming side is ready; the validating side doesn't exist. The schema passes unknown keys straight through, and the conversion that writes to the database turns a malformed value silently into null. First the field goes back into the schema and onto a hard gate, then I start filling it.
  2. For the 911 existing files the date comes from git. The instant of the commit that last changed the body is a record, not a guess. But doing it in one go means moving 911 lastmod values at once — the worst possible move while trying to earn the "consistent and verifiable" condition. It goes in batches, each file with its own date.
  3. New posts record the publication instant — with the offset. The trap is right here: write the time without the zone and the two readers disagree, so the same post goes out as 08:30 in the feed and 05:30 in the sitemap. What gets written is 2026-11-19T08:30:00+03:00, nothing less.

And one thing I'm deliberately not doing: I won't retrofit a time into the publishDate field
of the existing posts. I never observed that time. The day is right; the honest way to fill in
what's missing is to say that it's missing.

Questions for your own site

If you publish your own blog, documentation or changelog, the answers take five minutes:

  • How many distinct timestamps does your feed hold? Divide by the item count. If the ratio isn't close to 1, your ordering information isn't being published. (Mine is the Turkish feed.json; the English side of this blog is served by /en/rss.xml.)
  • In how many posts is date_modified byte-identical to date_published? If it's all of them, your corrections stay with you.
  • How many separate libraries read that same date? If your feed and your sitemap are produced by different code, hand both the same text and compare the output. In mine, with the timezone left off, the two answers are three hours apart.

Which document you read matters

I started this post with "precision is a claim"; the further the measurements went, the
narrower and more useful it got. The trailing .000 really is a claim, but the lesson sits
underneath it.

In my own chain there were four candidates: Astro's schema, Zod's coerce, JavaScript's Date
and YAML's timestamp type. The answer turned out to be not one of them but two at once — and I
found the second only after the first version of this post had been written wrong. Seeing every
surface print the same value had convinced me there was a single source; in fact there were two
separate rules arriving at the same answer.

A field's precision cannot exceed the precision of the measurement that fills it. An explanation
is no more correct than the code it describes is the code that runs. The same thing fixes both:
don't stop until you've found the line that produces the value — and don't assume there is only
one such line.

Official Sources

Top comments (0)