Display time
import datetime
# get current time
current_time = datetime.datetime.now()
# convert current time to string format
time_str = current_time.strftime("%H:%M:%S")
# display current time
print("Current time is:", time_str)
import datetime
# get current time
current_time = datetime.datetime.now()
# convert current time to string format
time_str = current_time.strftime("%H:%M:%S")
# display current time
print("Current time is:", time_str)
Comments
Post a Comment