Python strftime/strptime Directive Cheat Sheet

The directives used by datetime.strftime() and datetime.strptime().

Live demo: Enter a strftime format string and view it's output for Oct 31, 2036 at 6:30:02 PM.

Output:
Directive Meaning Example values

Common Format Examples