RFC 2822 in Python strftime()
The date format used in email headers and many HTTP contexts.
Format string
%a, %d %b %Y %H:%M:%S %z
Example output
Thu, 18 Jun 2026 13:45:30
Edit this format in the live tester →
In Python
from datetime import datetime
dt = datetime(2026, 6, 18, 13, 45, 30)
dt.strftime("%a, %d %b %Y %H:%M:%S %z")
# => "Thu, 18 Jun 2026 13:45:30 "
Directives used
| %a | Abbreviated weekday name in the current locale. | Thu |
| %d | Day of the month, zero-padded (01–31). | 18 |
| %b | Abbreviated month name in the current locale. | Jun |
| %Y | Year with century as a decimal number. | 2026 |
| %H | Hour (24-hour clock), zero-padded (00–23). | 13 |
| %M | Minute, zero-padded (00–59). | 45 |
| %S | Second, zero-padded (00–59; up to 61 historically for leap seconds). | 30 |
| %z | UTC offset as ±HHMM (empty if the datetime is naive). |