create date and time object python code example
Example 1: python date and time
from datetime import datetime
now = datetime.now()
print (now.strftime("%Y-%m-%d %H:%M:%S"))
Output: 2020-06-19 10:34:45
Example 2: python create date
import datetime
x = datetime.datetime(2020, 5, 17)
print(x)
# 2020-05-17 00:00:00