Skip to content

How to get the current year in Python?

import datetime
now = datetime.datetime.now().year
print(now)
See also  How to use information from env variables in Python?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.