Using datetime module write a program that gets the current date & prints the day of the week

#To display day of week of current/given date
import datetime
dayofweek = datetime.datetime.today().strftime("%A")
print("The day of week of today is:",dayofweek)

#for any given date
year=int(input("Enter year : "))
month=int(input("Enter month : "))
dt=int(input("Enter date : "))
dayofweek = datetime.date(year,month,dt).strftime("%A")
print("The day of week of the date",dt,month,year,"is",dayofweek)

Leave a Reply