Python Friendly Date and TimeΒΆ

Format Description

strftime Code

Example Output

Year-Month-Day

%Y-%m-%d

2099-08-03

Day-Month-Year

%d-%m-%Y

03-08-2099

Full month name, day, year

%B %d, %Y

August 3, 2099

Weekday, full month, day, year

%A, %B %d, %Y

Monday, August 3, 2099

Month/Day/Year (numeric)

%m/%d/%y

08/03/99

Full month and two-digit year

%B %y

August 99

Hour:Minute AM/PM

%I:%M %p

11:45 PM

Hour:Minute:Second (24-hour)

%H:%M:%S

23:45:01

Full datetime (24-hour)

%Y-%m-%d %H:%M:%S

2099-08-03 23:45:01

Full weekday name

%A

Monday