How to Get the Current Year, Month, and Day as Integers in Python 3 using the datetime Module

Currently working on a project where I need to get the current year, month, and day as integers in Python 3, and noticed that the #1 ranked Google search result for my search resulted in an old answer written in Python 2. While I guess it’s not really a big deal, here is my updated Python 3 code (nothing is different other than the print statements, lol):

# REFERENCE: https://bit.ly/2JtjSto
import datetime
now = datetime.datetime.now()
print(now.year)
print(now.month)
print(now.day)
 

topherPedersen