HomeDocs › %h

Python strftime directive %h

Equivalent to %b (abbreviated month name).

Example (from datetime(2026, 6, 18, 13, 45, 30))
Jun

In Python

from datetime import datetime
dt = datetime(2026, 6, 18, 13, 45, 30)
dt.strftime("%h")
# => "Jun"

Parsing with strptime

Same as %b. See strptime.dev for the parsing side.

Try %h in the live tester →

Other Month directives