import datetime py code example
Example 1: import datetime
from datetime import datetime
date = datetime.now()
print(date)
# Prints in the format year, month, day, hour, minute, second, and microsecond
Example 2: python datetime module
import datetime as d
time = d.datetime.now()
time = time.strftime("%Y-%m-%d %H:%M:%S")
#year-#month-#date #hour:#minure:#second
print(time)