You can instantiate date objects from the
date class. A date object represents a date (year, month and day). You can also instantiate a datetime object from the
datetime class. A datetime object represents a date + time (year, month, day, hours, minutes, seconds).
import datetime d = datetime.date(2014, 9, 7) dt = datetime.datetime(2020, 12, 24, 22, 9, 24) print(d) print(dt)
2014-09-07 2020-12-24 22:09:24