HomeCommon › RFC 2822

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

%aAbbreviated weekday name in the current locale.Thu
%dDay of the month, zero-padded (01–31).18
%bAbbreviated month name in the current locale.Jun
%YYear with century as a decimal number.2026
%HHour (24-hour clock), zero-padded (00–23).13
%MMinute, zero-padded (00–59).45
%SSecond, zero-padded (00–59; up to 61 historically for leap seconds).30
%zUTC offset as ±HHMM (empty if the datetime is naive). 

Related formats