import datetime now = datetime.datetime.now().year print(now)

Read more of this post