Skip to content
  • (+91) 9409548155
  • support@appdividend.com
  • Home
  • Pricing
  • Instructor
  • Tutorials
    • Laravel
    • Python
    • React
    • Javascript
    • Angular
  • Become A Tutor
  • About Us
  • Contact Us
Menu
  • Home
  • Pricing
  • Instructor
  • Tutorials
    • Laravel
    • Python
    • React
    • Javascript
    • Angular
  • Become A Tutor
  • About Us
  • Contact Us
  • Home
  • Pricing
  • Instructor
  • Tutorials
    • Laravel
    • Python
    • React
    • Javascript
    • Angular
  • Become A Tutor
  • About Us
  • Contact Us
Python

How to Find a Day of the Week for a Given Date in Python

  • 11 Dec, 2025
  • Com 0
How to Find a Day of the Week for a Given Date in Python

Want to know on which day you were born? Here’s a simple way to find out.

Using datetime.date.weekday() to find the day of a date in Python

The most efficient way to find a day of the week for a specific day in Python is to use datetime.date.weekday() method to get the index of that day, and enter that index into the calendar.day_name to map the index to a specific day.

In a week, day_name() maps the index as follows:

Index Day Name
0 Monday
1 Tuesday
2 Wednesday
3 Thursday
4 Friday
5 Saturday
6 Sunday

I was born on 10th September 1993. Let’s find out the day for that date.

from datetime import date
import calendar

born_date = date(1993, 9, 10)

id_of_day = born_date.weekday()

print(id_of_day)   
# 4 (It start from Monday as 0, so Sunday is 6)

print(calendar.day_name[id_of_day])
# Friday

That means I was born on Friday.

Alternate approaches

Using strftime()

Using strftime() to get the day of a date

Another user-friendly approach is to use the datetime.strftime() method.

The strftime() lets you use the “%A” argument to find the exact full day from the datetime object.

You can also expand into that by using an abbreviated name like “Mon” instead of “Monday” with the help of the “%a” argument.

For better human-readable output, format the date and add a day.

The strftime() lets you customize the format in which you print a date. However, it returns a string rather than an object. It is only valid when you want to print a string.

from datetime import datetime

date = datetime(1995, 3, 6)

# Full day name
full_name = date.strftime('%A')
print(full_name)
# Output: Monday

# Abbreviated name
short_name = date.strftime('%a')  # Wed
print(short_name)
# Output: Mon

# Custom format with day
formatted = date.strftime('%A, %B %d, %Y')
print(formatted)
# Output: Monday, March 06, 1995

Using calendar.weekday()

The calendar.weekday() method has one advantage: it does not require a datetime object. You just need to enter a date in (year, month, day) format. It returns the index of that day. Monday has index 0 and Sunday has index 6.

Now, you can enter this index into the calendar.day_name to find the exact name of the day.

import calendar

index = calendar.weekday(1947, 8, 15)

day = calendar.day_name[index]

print(day)

# Output: Friday

Using the ISO Standard: isoweekday()

If you are working on international standards compliance and database integration, use the .isoweekday() method. It returns returns an ISO‑8601 integer (Monday = 1, Sunday = 7). In some time zones and locations, there is no 0 index.

from datetime import datetime

date = datetime(2026, 1, 1)

iso_day = date.isoweekday()  # Returns 1-7 (Monday=1, Sunday=7)

print(f"ISO day: {iso_day}")  

# Output: ISO day: 4 (Thursday)

That’s all!

Post Views: 14
Share on:
Krunal Lathiya

With a career spanning over eight years in the field of Computer Science, Krunal’s expertise is rooted in a solid foundation of hands-on experience, complemented by a continuous pursuit of knowledge.

How to Convert Unix time(Epoch time) to datetime and Vice Versa in Python
Python strftime(): Converting Datetime to String

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Address: TwinStar, South Block – 1202, 150 Ft Ring Road, Nr. Nana Mauva Circle, Rajkot(360005), Gujarat, India

Call: (+91) 9409548155

Email: support@appdividend.com

Online Platform

  • Pricing
  • Instructors
  • FAQ
  • Refund Policy
  • Support

Links

  • About Us
  • Contact Us
  • Privacy Policy
  • Terms of services

Tutorials

  • Angular
  • React
  • Python
  • Laravel
  • Javascript
Copyright @2024 AppDividend. All Rights Reserved
Appdividend