get current date in year-month-day python code example Example: get the current year in python import datetime now = datetime.datetime.now().year print(now)