Important Notice:

Course Content
The Calendar Module
Library Function/Predefined Functions
0/4
Sys Module
Library Function/Predefined Functions
0/2
OS Module
Library Function/Predefined Functions
0/2
Functions in Python (Chapter-10) M3-R5
About Lesson

Today():-

        Today() metho defined in the date class to get a date object containing the current local date.

import datetime

print(datetime.date.today())

dat=datetime.date.today()

print(dat)

Output

2023-06-22

2023-06-22

 

 

from datetime import date

today=date.today()

print(“Current Year “,today.year)

print(“Current Month “,today.month)

print(“Current Day “,today.day)

Output

Current Year  2023

Current Month  6

Current Day  22

error: Content is protected !!