google.com, pub-8786015629279405, DIRECT, f08c47fec0942fa0 Write a Program to Implement Calendar and Current Date Using Module in Python

Write a Program to Implement Calendar and Current Date Using Module in Python

1

 

  

# Python program to display calendar of
# given year

# import module

import calendar
from datetime import datetimedate

today date.today()

# dd/mm/YY
f1 today.strftime("%d/%m/%Y")
print("Date Format in dd/mm/yy ="f1)

# Textual month, day and year
f2 today.strftime("%B %d, %Y")
print("Date Format month, day and year ="f2)

# mm/dd/y
f3 today.strftime("%m/%d/%y")
print("Date Format in mm/dd/y ="f3)

# Month abbreviation, day and year
f4 today.strftime("%b-%d-%Y")
print("Month , day and year ="f4)

# Print Calender

print ("The calender of year 2021 is : ")
print (calendar.calendar(2021))

 

Output:

Date Format in dd/mm/yy = 07/02/2021

Date Format month, day and year = February 07, 2021

Date Format in mm/dd/y = 02/07/21

Month , day and year = Feb-07-2021

The calender of year 2021 is :

 

 


Post a Comment

1 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

Thank you for your interest 😊

We will back shortly after reviewing...

Thank you for your interest 😊

We will back shortly after reviewing...

Post a Comment

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !
To Top