Holiday orders pile up fast, and you first want the day of the week from each pickup date: is it a Saturday? Python gets that in one line.
Quick answer: call d.weekday() for a number (Monday is 0, Sunday is 6) or d.strftime("%A") for the name. For November 26, 2026 you’ll get 3 and 'Thursday'.
In this tutorial, we’ll get the day of the week from a date in Python as a number, a name, a weekend flag and a pandas column. I ran every example in Python 3.12.5.
What You Need to Find the Day of the Week in Python
Only datetime and calendar, plus pandas 3.0.6 for Step 5. You’ll reuse five 2026 pickup dates from an Austin bakery in pickups.py:
# Holiday pickup dates for an Austin bakery
PICKUPS = ["2026-02-16", "2026-07-04", "2026-11-26",
"2026-12-25", "2026-03-15"]
Dates still stored as text? Convert the string to a date in Python first, or follow Step 3.
Step 1: Get the Weekday Number with Python datetime weekday()
The Python datetime weekday() method returns 0 (Monday) to 6 (Sunday); isoweekday() returns 1 to 7:
from datetime import date
from pickups import PICKUPS
for text in PICKUPS:
d = date.fromisoformat(text)
print(f"{d:%b %d, %Y} weekday() {d.weekday()} "
f"isoweekday() {d.isoweekday()}")
Output:
Feb 16, 2026 weekday() 0 isoweekday() 1
Jul 04, 2026 weekday() 5 isoweekday() 6
Nov 26, 2026 weekday() 3 isoweekday() 4
Dec 25, 2026 weekday() 4 isoweekday() 5
Mar 15, 2026 weekday() 6 isoweekday() 7

Thanksgiving returns 3, a Thursday. Both methods also work on a datetime, including the current date and time in Python.
Step 2: Get the Day Name with strftime(“%A”) or calendar.day_name
People want names, not numbers. Same five dates, three ways:
import calendar
from datetime import date
from pickups import PICKUPS
for text in PICKUPS:
d = date.fromisoformat(text)
print(f"{text} {d:%A} {d:%a} {calendar.day_name[d.weekday()]}")
print("Today is", date.today().strftime("%A"))
Output:
2026-02-16 Monday Mon Monday
2026-07-04 Saturday Sat Saturday
2026-11-26 Thursday Thu Thursday
2026-12-25 Friday Fri Friday
2026-03-15 Sunday Sun Sunday
Today is Friday

%A is the full name, %a the short one, and calendar.day_name is indexed with weekday(). Both follow the locale.
Step 3: Get the Day of the Week from a Date String in Python
Orders often arrive as text like 07/04/2026. Parse it with strptime(), or pass the numbers to calendar.weekday():
import calendar
from datetime import datetime
order = datetime.strptime("07/04/2026", "%m/%d/%Y")
print(order.strftime("%A, %B %d, %Y"))
n = calendar.weekday(2026, 12, 25)
print(n, calendar.day_name[n])
Output:
Saturday, July 04, 2026
4 Friday
That prints Saturday, July 04, 2026; calendar.weekday(2026, 12, 25) returns 4, Friday.
Step 4: Check Whether a Date Falls on a Weekend
Saturday is 5 and Sunday is 6, so weekday() >= 5 is the weekend test:
from datetime import date
from pickups import PICKUPS
for text in PICKUPS:
d = date.fromisoformat(text)
kind = "weekend" if d.weekday() >= 5 else "weekday"
print(f"{d:%a %b %d}: {kind}")
Output:
Mon Feb 16: weekday
Sat Jul 04: weekend
Thu Nov 26: weekday
Fri Dec 25: weekday
Sun Mar 15: weekend

Pair it with subtracting days from a date in Python to step back to the previous Friday.
Step 5: Get the Day of the Week in pandas with dt.dayofweek
Got dates in a CSV or Excel file? The pandas .dt accessor handles every row:
import pandas as pd
from pickups import PICKUPS
df = pd.DataFrame({"pickup": pd.to_datetime(PICKUPS)})
df["dayofweek"] = df["pickup"].dt.dayofweek
df["day_name"] = df["pickup"].dt.day_name()
print(df)
Output:
pickup dayofweek day_name
0 2026-02-16 0 Monday
1 2026-07-04 5 Saturday
2 2026-11-26 3 Thursday
3 2026-12-25 4 Friday
4 2026-03-15 6 Sunday

dt.dayofweek counts Monday as 0 too. Text column? Convert the pandas column to datetime first.
Python Day of Week Cheat Sheet
| Code | Returns | Nov 26, 2026 |
|---|---|---|
d.weekday() | 0-6, Monday = 0 | 3 |
d.isoweekday() | 1-7, Monday = 1 | 4 |
d.strftime("%A") | Full name | Thursday |
Series.dt.day_name() | pandas names | Thursday |
Does Python weekday() Start on Monday or Sunday?
Monday: weekday() returns 0 for it. For Sunday as 0, use (d.weekday() + 1) % 7.
Day-of-Week Mistakes We See in Python Code
Two slips: indexing day_name with isoweekday(), and reading d.day:
import calendar
from datetime import date
d = date(2026, 11, 26) # a Thursday
print(calendar.day_name[d.isoweekday()]) # wrong
print(calendar.day_name[d.isoweekday() - 1]) # right
print("d.day =", d.day) # day of month
Output:
Friday
Thursday
d.day = 26
Thanksgiving prints as Friday until you subtract 1, and d.day is just the day of the month. For the day number in the year, see getting the day of the year in Python.
Where the Python Day of Week Fits Next
The next Python job is usually grouping dates by week. Our post on getting the week number from a date in Python uses the same ISO calendar.
We’d keep these date tutorials open next:
- Get the last day of a month in Python
- Check for a leap year in Python
- Count the months between two dates in Python
- Naive vs aware datetime in Python
Python Weekday Questions, Answered
How do I get the day of the week in Python?
Use d.weekday() or d.strftime("%A").
What is the difference between weekday() and isoweekday()?
weekday() returns 0-6; isoweekday() returns 1-7. Both start on Monday.
How do I get the day name from a date in Python?
Use d.strftime("%A") for 'Thursday' or %a for 'Thu'.
How do I check if a date is a weekend in Python?
Test d.weekday() >= 5; Saturday is 5 and Sunday is 6.
How do I get the day of the week in pandas?
Use df["col"].dt.dayofweek for numbers or .dt.day_name() for names.
Where is weekday() documented?

Bijay Kumar is a 13-time Microsoft MVP with more than 18 years in software development, and the founder of Python Guides and TSinfo Technologies. He started out building .NET and SharePoint solutions at HP, TCS and KPIT before moving into Python, machine learning and AI, and he also builds web apps with TypeScript and React. He writes the tutorials here himself, and every example is run before publishing so you see the real output. More about Bijay · Microsoft MVP profile · LinkedIn