datetime to datetime python code example
Example 1: convert datetime to date python
datetime.datetime.now().date()
Example 2: datetime year python
import datetime
now = datetime.datetime.now()
print(now.year, now.month, now.day, now.hour, now.minute, now.second)