Syndicator Blog

RSS

RFC 822 and RFC 3339 Dates in Feeds, and the Time Zone Bugs Each One Causes

Every feed reader sorts by date, and every aggregator decides what counts as new by comparing dates. So the field that looks too boring to get wrong does the most damage when it's wrong. RSS and Atom use two different date formats, and the parsers that read them are lenient in different, unpredictable ways. A date that one reader takes in stride can land five hours off in another, or jump to the top of a page every time it rebuilds.

This post covers what each format asks for, what WordPress and Hugo actually send, and what happened when 17 date strings went through Syndicator's own parser, Python's standard library and Go's time package.

Two formats for one job

RSS 2.0 says its dates follow RFC 822, the old email date format, with a four-digit year. It looks like this:

<pubDate>Mon, 23 Nov 2026 09:00:00 +0000</pubDate>

The day name is optional, and so are the seconds. The time zone has to be one of a short list: UT, GMT, the four US zones in their standard and daylight forms (EST, EDT, CST, CDT, MST, MDT, PST, PDT), a single military letter, or a numeric offset like +0200. That is the exact list the W3C Feed Validation Service checks against. CET, IST, BST and AEST are not on it. The military letters are a trap of their own: RFC 1123 later noted that RFC 822 got their signs backward, so they are best avoided.

Atom uses RFC 3339, the ISO-style timestamp:

<updated>2026-11-23T09:00:00Z</updated>

Every part is required except fractional seconds. The T and the Z have to be uppercase, and a value with no Z and no numeric offset is invalid. A space instead of the T, or a missing zone, are the two errors the validator's documentation calls common.

The two formats can't be mixed. An ISO date in an RSS pubDate is an error, and so is an RFC 822 date in an Atom updated.

What WordPress and Hugo send

Both big generators get this right out of the box. WordPress builds the RSS pubDate in feed-rss2.php from the post's GMT time with the format string D, d M Y H:i:s +0000, and its Atom feed uses Y-m-d\TH:i:s\Z. Hugo's built-in RSS template formats .PublishDate with Go's layout Mon, 02 Jan 2006 15:04:05 -0700, a numeric offset.

Problems start when someone writes their own template or feed code. The validator's documentation lists the usual mistakes: localized month or day names, zone names that aren't on the list, and ISO dates in RSS, which it says older Movable Type versions produced.

The test

Each of the 17 strings was put inside a minimal RSS item and passed through parseFeed from Syndicator's lib/xml.mjs, which uses JavaScript's new Date() under Node 22. The same strings went through Python's email.utils.parsedate_to_datetime and Go 1.24's time.Parse, trying the RFC1123Z, RFC1123 and RFC3339 layouts in turn. The validator column comes from the RFC 822 patterns in the feedvalidator source. Ten of them are below. The right answer for every row is 09:00 UTC on November 23, 2026.

pubDate valueSyndicator (Node)Python email.utilsGo time.ParseValidator
Mon, 23 Nov 2026 09:00:00 +0000correctcorrectcorrectvalid
Mon, 23 Nov 2026 04:00:00 ESTcorrectcorrect04:00 UTC, 5 hours offvalid
Mon, 23 Nov 2026 09:00 +0000correctcorrectrejectedvalid
Mon, 23 Nov 26 09:00:00 +0000correctcorrectrejectedwarning
Tue, 23 Nov 2026 09:00:00 +0000correct, wrong day ignoredcorrect, wrong day ignoredcorrect, wrong day ignorederror
Mon, 23 Nov 2026 10:00:00 CETunparsed, build time used10:00, no zone10:00 UTC, 1 hour offerror
Mon, 23 Nov 2026 09:00:00 Zcorrectcorrectrejectedvalid
Mon, 23 Nov. 2026 09:00:00 +0000correctrejectedrejectederror
2026-11-23T09:00:00Zcorrectrejectedcorrecterror
2026-11-23T09:00:00depends on server zonerejectedrejectederror

Go guesses at zone names

Go's result for EST looks like a bug, and it is documented behavior. The time.Parse docs say that when a zone abbreviation is unknown, "Parse records the time as being in a fabricated location with the given zone abbreviation and a zero offset." Known means known to the machine's local time zone. Run the same EST string with TZ=America/New_York and Go gets it right. Run it on a UTC server and it's five hours off.

IST shows how odd this gets. Mon, 23 Nov 2026 14:30:00 IST came out as 14:30 UTC on a UTC machine, 09:00 UTC with TZ=Asia/Kolkata (India Standard Time) and 12:30 UTC with TZ=Asia/Jerusalem (Israel Standard Time). Same feed, three answers, decided by the reader's server. Go's own advice in the docs is to prefer layouts with a numeric offset.

JavaScript drops what it doesn't know

V8's Date parser knows the US zones, so EST, EDT and PST come out right. It returns Invalid Date for CET, IST and BST. In Syndicator, an unparseable date falls back to the build time, so that item gets stamped with the newest time on the page and sorts to the top. Each rebuild gives it a fresh build time, so it stays there until it scrolls out of the feed itself.

ISO strings without an offset have a different problem. JavaScript reads 2026-11-23T09:00:00 as local time but 2026-11-23 as UTC. With TZ=America/New_York the first one became 14:00 UTC. The answer depends on where the code runs, which is the worst kind of date bug.

Syndicator's parseFeed checks pubDate first, then published, then updated. For Atom that means an entry's original publish date wins over its last edit, so fixing a typo in an old post doesn't push it back to the top.

Python keeps the clock and drops the zone

parsedate_to_datetime handled every proper RFC 822 form, including the two-digit year. For CET and IST it returned 10:00 and 14:30 with no zone at all, a naive datetime. Code that then treats naive times as UTC is off by an hour or more without any error. For Atom, datetime.fromisoformat is the matching tool, and it is looser than RFC 3339: it took a space separator and a missing zone without complaint.

What to do

If you publish a feed:

  • In RSS, always use a numeric offset or GMT. +0000 is the safest choice, and it's what WordPress does.
  • Use English day and month names with no periods, a four-digit year and seconds.
  • Make sure the day name matches the date, or leave it out. Every parser here ignored a wrong day, but the validator flags it as an error.
  • In Atom, use a full timestamp with Z or an offset. Never a bare date or a local time.
  • Run the feed through the validator once after any template change.

If you read feeds:

  • Treat named zones outside the RFC 822 list as unknown, and log them instead of guessing.
  • In Go, try RFC1123Z before RFC1123, and add layouts without seconds or the day name if you want to accept everything RFC 822 allows.
  • Decide on purpose what an unparseable date should mean. Build time is the simplest fallback, and it puts broken items at the top.

Dates in the channel matter too. A template that writes the current time into lastBuildDate changes the file on every build and defeats conditional GET. If you are still choosing a format, RSS vs Atom vs JSON Feed covers the tradeoffs.