Python Get Day Name from Number Example

By Hardik Savani October 30, 2023 Category : Python

In this post, we will learn python get day name from number. I would like to share with you python get day name from date. I would like to show you python calendar get day name. I explained simply step by step python number to day name.

In this example, I will give two examples for you of how to get the day name from number in python. therefore, let's see below example code and try it.

Example 1:

import calendar
dayNumber = 0
dayName = calendar.day_name[dayNumber]
print("Day Name : " + str(dayName))


Day Name : Monday

Example 2:

from datetime import date
currentDate =
longName = currentDate.strftime('%A')
print("Long Day Name : " + longName)
shortName = currentDate.strftime('%a')
print("Short Day Name : " + shortName)


Long Day Name : Wednesday
Short Day Name : Wed

I hope it can help you...

Tags :