how to get the current date and time in python code example
Example 1: oython get time
from datetime import datetime
now = datetime.now()
current_time = now.strftime("%H:%M:%S")
print("Current Time =", current_time)
Example 2: print current date
from datetime import date
today = date.today()
print("Today's date:", today)