How to Use This Tool
Paste any date to get the header format, or paste a header to read it back. The lower box builds a matching pair of cache headers for a lifetime you choose.
The format, exactly
Mon, 10 Aug 2026 12:34:56 GMT. Every part is constrained:
- Day and month names in English, three letters, regardless of the server's locale. A server formatting dates in the local language produces a header no client can read.
- Two-digit day, with a leading zero where needed.
- Four-digit year.
- The literal string GMT — not UTC, not
+00:00, not an offset. The specification requires those three characters. - Seconds resolution. There is no place for milliseconds.
In JavaScript, Date.prototype.toUTCString() produces exactly this, which makes it the
one-line answer. toISOString() does not, and using it is the usual mistake.
Why the failure is silent
A cache that cannot parse a date header does not report an error — it treats the value as being
in the past. So an Expires header in the wrong format means the response is considered
stale immediately, and everything is re-fetched every time.
Nothing breaks. Pages still work. The only symptom is that your caching does not happen, which generally goes unnoticed until someone looks at the origin traffic and wonders why it is so high.
Prefer Cache-Control and ETag
Expires is an absolute moment, which means it depends on the client's clock being right.
A machine with a wrong clock ignores your caching entirely. Cache-Control: max-age=3600 is a
duration instead, so it works regardless, and it takes precedence when both are present.
Similarly, Last-Modified only has second resolution, so a file changed twice within one
second will not be detected as modified. An ETag compares content rather than time and does
not have that problem. Send both if you like — clients use whichever they support — but the
modern pair is Cache-Control and ETag.
Where you still meet this format
Date— when the response was generated. Required on most responses.Last-ModifiedandIf-Modified-Since— the conditional request pair.Expires— legacy absolute expiry, still widely sent alongsideCache-Control.Set-Cookie'sExpiresattribute — same format, and a frequent source of cookies that vanish immediately because the date was written another way.- Email headers, which use a close relative from RFC 5322 that permits numeric offsets like
+0000as well.
