RFC 2822 Date Format for Email and HTTP
Understand the RFC 2822 date format used in email headers, HTTP headers, and RSS feeds. Learn the structure, timezone abbreviations, and how to generate it in code.
Detailed Explanation
RFC 2822 — Email and HTTP Date Format
RFC 2822 (and its predecessor RFC 822) defines the date format used in Internet email headers, HTTP protocol headers, and RSS/Atom feeds. While less popular than ISO 8601 for new APIs, it remains critical for email and web infrastructure.
Format Structure
Sat, 28 Feb 2026 14:30:00 +0900
Breaking this down:
Sat— Three-letter weekday abbreviation (optional)28— Day of month (1 or 2 digits)Feb— Three-letter English month abbreviation2026— Four-digit year14:30:00— Time in 24-hour format+0900— Timezone offset (no colon separator)
Key Differences from ISO 8601
| Feature | ISO 8601 | RFC 2822 |
|---|---|---|
| Month | Numeric (02) |
English abbreviation (Feb) |
| Separator | T |
Space |
| Timezone | +09:00 or Z |
+0900 or abbreviation |
| Weekday | Not included | Optional prefix |
| Sortable | Yes (string sort works) | No (requires parsing) |
Timezone Abbreviations
RFC 2822 allows named timezone abbreviations:
- UT / GMT — Universal/Greenwich Mean Time (+0000)
- EST / EDT — Eastern Standard/Daylight Time (-0500/-0400)
- CST / CDT — Central Standard/Daylight Time (-0600/-0500)
- MST / MDT — Mountain Standard/Daylight Time (-0700/-0600)
- PST / PDT — Pacific Standard/Daylight Time (-0800/-0700)
However, numeric offsets are strongly preferred because timezone abbreviations are ambiguous (CST can be Central Standard Time, China Standard Time, or Cuba Standard Time).
Language Patterns
| Language | Pattern |
|---|---|
| JavaScript (date-fns) | EEE, dd MMM yyyy HH:mm:ss xx |
| Python | %a, %d %b %Y %H:%M:%S %z |
| Java | EEE, dd MMM yyyy HH:mm:ss XX |
| PHP | D, d M Y H:i:s O |
| Go | Mon, 02 Jan 2006 15:04:05 -0700 |
Use Case
RFC 2822 format is required for email Date headers (SMTP), HTTP Date headers (Last-Modified, Expires, Date), RSS feed pubDate elements, and cookie expiration dates. Understanding this format is essential for email processing and HTTP caching implementation.