xxxxxxxxxx
from datetime import date
today=date.today()
print("today date is ",today )
xxxxxxxxxx
import time
time.time()
# In The OutPut It will show no of secs. For EXAMPLE:- Mine is 1668486863.7566664
print(time.ctime(1668486863.7566664))
# Then the Date and Time will seen in Output:- Tue Nov 15 10:04:23 2022
xxxxxxxxxx
import time
# Getting time and date
local_time = time.localtime(time.time())
print(f"local current time: {local_time}")
# Getting formatted time and date
local_time = time.asctime(time.localtime(time.time()))
print(f"local current time: {local_time}")